Page 1 of 1

Search/replace list issues

Posted: Tue Jan 03, 2012 3:48 am
by dfhtextpipe
There are subtle but critical differences in the way that replace filters work!

Here is the required action:

Code: Select all

Perl pattern [(\Q\i0 \E)] with [\\nosupersub$1\\super ]
   [X] Match case
   [ ] Whole words only
   [ ] Case sensitive replace
   [ ] Prompt on replace
   [ ] Skip prompt if identical
   [ ] First only
   [ ] Extract matches
   Maximum text buffer size 4096
   [ ] Maximum match (greedy)
   [ ] Allow comments
   [ ] '.' matches newline
   [X] UTF-8 Support
Compare using the following two methods:
  • Method 1: Find pattern (perl style)
    Method 2: Search/replace list
  • Method 1 works as required.
    Method 2 does not!
With the former, priority is given to the "\\" part of the replacement pattern, and this is correctly interpreted as specifiying a literal "\".
With the latter, priority is given to the "\n" part of the replacement pattern, and this is incorrectly interpreted as a "new line".

The contextual help for both methods does not give any clue why the results should be different.
In fact the help for both methods ultimately leads one back to the pattern matching reference.

Method 2 is summarized as "This filter is used to easily define a set of search/replace pairs that have identical search options."

I discovered the issue after combining several consecutive replace filters (with identical search options) into a search/replace list.
It was somewhat annoying to have to add workarounds to address this issue, especially after having tested and debugged and each filter separately.

David

Re: Search/replace list issues

Posted: Sun Jan 22, 2012 10:27 pm
by DataMystic Support
Hi David,

We found the bug - it only occurs in the replacement term for search/replace lists when consecutive search was selected.

It will be fixed in v9.0 shortly.

Re: Search/replace list issues

Posted: Wed Jan 25, 2012 6:18 pm
by dfhtextpipe
Excellent!

Good to know that my issue report was something that led you to find the root cause and fix it.

David