Matching on NOT comma

Syntax highlighting, code folding, brace matching, code indenting, and function list

Matching on NOT comma

Postby rmoore777 » Wed Sep 20, 2006 6:33 pm

I am trying to set up a function string to distinguish between:

TEST # 9999 (other text)
and
TEST # 9999, (other text)

I want to select the first version and not the second

If I use:
/Function String 1 = "TEST # [0-9]+[ ]"

it works OK. But I want to match on the absence of the comma not the existence of the space so tried:

/Function String 1 = "TEST # [0-9]+[~,]"
to match on NOT the comma and it does not work. I do not understand why not. Could someone help? Thanks in advance.
User avatar
rmoore777
Newbie
 
Posts: 1
Joined: Tue Sep 19, 2006 11:00 pm

Re: Matching on NOT comma

Postby Mofi » Thu Sep 21, 2006 11:21 am

Use    /Function String 1 = "TEST # [0-9]+[~,0-9]"

It looks like the UltraEdit regex engine has a problem on which character [~,] should be applied after [0-9]+. It is always a problem when a range of characters follows a range of characters and the 2 ranges have an overlapping character set. [~,] exactly means all characters except , and not NOT ,. The additional 0-9 in the 2nd ALL EXCEPT range helps in this situation because the 2 ranges then don't have an overlapping character set anymore.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Syntax Highlighting