Page 1 of 1

Search and replace regular expression bug

Posted: Thu Aug 15, 2013 11:31 pm
by gwgs
When I use the pattern

Code: Select all

(CALL errorlog\()([A-Za-z0-9_.,' "\|\)\(\n]+)(\)$)
as a regular expression in a Find/Replace, It will not find the code below

Code: Select all

      CALL errorlog("FUNCTION v1716_txfer_post_stock(", 
                     l_tferqty, ",", 
                     l_smavgcst, ",", 
                     i, ",", 
                     l_dockno CLIPPED, ")")
unless I define it as

Code: Select all

(CALL errorlog\()([A-Za-z0-9_.,' "\|\)\(\n\n\n\n]+)(\)$)
then it will find it and any other lines that match the pattern that have less than 4 new lines in the pattern matched


I hope i've made this clear, and reproducible :)


Zeus 3.97q beta4
win7 pro 64-bit


Grant

Posted: Fri Aug 16, 2013 1:02 am
by jussij
Hi Grant,

What you have found is a limitation of the Zeus searching :(

Internally, Zeus holds the file as a list of individual lines, meaning the '\n' characters don't actually exist.

As such searching for the '\n' character is not possible and for many years Zeus couldn't actually search for the '\n' character.

But after so many requests for this feature a work around option was added.

To make this work the search code checks for '\n' characters in the search string and if it finds any it builds a temporary search buffer by concatenating lines and to know how many lines to concatenate it counts the number of '\n' characters in the search string.

That is why your second search worked, but not the first.

Cheers Jussi