Unexpected regex results...Greedy ignored...

General discussions about Advanced Find and Replace
Post Reply
TetleyTeaGuy
Posts: 4
Joined: Tue Feb 21, 2006 4:24 pm

Unexpected regex results...Greedy ignored...

Post by TetleyTeaGuy » Thu Oct 16, 2008 7:02 pm

This is my source text...

<OPTION>
<PROC>FeedCal</PROC>
<PARAM>
<![CDATA[(0.70)]]>
</PARAM>

and this is my regex.. in batch replace. Using the latest trial of 4.1. ( I own ver 3.0 and love it, Thanks a bunch Roman!)
(FeedCal.{35})[-]?[01][\.]?[0-9]?[05]?

however it does not match the complete 0.70 which is what I am trying to replace....(using $1-999 so that 0.70 is replaced with -999). It only matches the first 0 and not the complete 0.70.

If you use the following regex
(FeedCal.{35})[-]?[01][\.][0-9][05]

then it works (that is it replaces 0.70 with -999), but this is unexpected...It appears to not respect the greedy quantifier.

Peace....

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests