Support for search and replace function
Brought to you by:
mattes432
Many times this was discussed here and in other rounds.
Starting with the milestone 1.12 I will mostlikely focus on S&R feature.
Requests like https://sourceforge.net/p/analyseplugin/discussion/1662529/thread/0c6dc257/
have been put requesting this.
Anonymous
Hi All,
while thinking about S&R feature I thought it's probably a good idea to get your feedback on a concerned question comnig up on this.
Let's assume you want to have sevral patterns being replaced and more or less the second pattern catches the same line / same text in the original text as the first and replaces some overlapping text. What would be the expected behavior?
All this choices have consequences and I'm uncertain which would th ethe one I should try out.
Here my initial opinions:
for 1.) I'm very much in favor or deterministic behavior and this rises to be magic if I would try to make any "intelegent" combination of S&R results. It would be a nightmare for people to write and trial n. error until the expected result becomes visible.
for 2.) this seems to be very consistent to current behavior of coloring in the text, however, it has the side effect, that the S&R of pattern 1 may look as omitted although the search pattern would still hold good. Anyway this is the way which is currently in favor.
for 3.) this looks like being very attractive in the first view as it would be kind of a "batch replacement". But this would have two quite bad side effects. a) assuming the result of the text does not look like wanted. How to find out which of the "intermediate steps did propably fail?
b) also it would mean that I have to hold several copies of the complete text for the intermediate S&R steps as the scope of the always next pattern again has to be applied to the complete "new" text. Hence, this behavior is probably not a good choice, but waiting for your comments and arguments.
for 4.) Any algorithmic description of how to apply multiple S&R actions is welcome and may help to bring me forward with my thoughts.
Please, comment!