Search and replace regular expression bug

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Search and replace regular expression bug

Post by gwgs » Thu Aug 15, 2013 11:31 pm

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


Site Admin
Posts: 2447
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Fri Aug 16, 2013 1:02 am

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

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 20 guests