Or RegEx not working as expected (tom|bob|frank)

Find, replace, find in files, replace in files, regular expressions

Or RegEx not working as expected (tom|bob|frank)

Postby Quadko » Sat Aug 20, 2005 3:01 pm

An OR search for (Tom|Bob) works, but a search for more than two items like (Tom|Jack|Bob) never finds Jack, only Tom and Bob. Is this a normal quirk of RegEx's or is this something that should be working?

Fred Tom Jack Bob Frank Fred Jack Bob Frank Fred Tom Jack Bob Frank Fred Tom Jack Frank Fred Tom Bob Frank

I can work around this doing the searches separately, but it would be nice to do them all together.

(Using UE32 11.00a+)
User avatar
Quadko
Newbie
 
Posts: 9
Joined: Thu Aug 18, 2005 11:00 pm

Re: Or RegEx not working as expected (tom|bob|frank)

Postby mrainey56 » Sat Aug 20, 2005 4:12 pm

It's been a known UE RegEx quirk for years.

Edit: The Perl compatible regular expression engine of UE v12.00 and later supports now more than 2 arguments in an OR expression.
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Or RegEx not working as expected (tom|bob|frank)

Postby Quadko » Tue Aug 23, 2005 4:29 pm

:) That explains it.

I love UltraEdit and have gotten quite addicted to it, but is there another companion tool you might recommend that does a super job at RegEx manipulation of text files? All the editors I know are like UE and do the basic easier RegEx but avoid the complex and harder implementations.
User avatar
Quadko
Newbie
 
Posts: 9
Joined: Thu Aug 18, 2005 11:00 pm

Re: Or RegEx not working as expected (tom|bob|frank)

Postby Quadko » Tue Aug 23, 2005 4:35 pm

(Note to self: Google search before asking questions, silly!)

I am still very interested in any recommendations you have, but I was able to come up with:
http://www.regular-expressions.info
and linked tools:
* PowerGREP
* RegExBuddy
* EditPadPro

I'll give those a look
User avatar
Quadko
Newbie
 
Posts: 9
Joined: Thu Aug 18, 2005 11:00 pm


Return to Find/Replace/Regular Expressions