[thelist] Escaping Parenthesis in RegExp

Robert Goodyear rob_goodyear at yahoo.com
Fri Mar 8 23:36:01 CST 2002


In UltraEdit's RegExp syntax, the ^ is used to escape, but when using tagged
expressions it all goes haywire, for example in the following string,

This is a test of (123) in a replacement.

If I want to change "(123)" to "Number:123", the RegExp...

Find: ^(^(???^)^)
Replace: Number:^1

...completely blows up. I've tried using the backslash for escaping, too, and
that doesn't work. I believe the Tagged Expressions are what's causing the
problem, as UE uses ^( and ^) to delimit a tagged exp, which is identical to
what an escaped special character should look like.

I've done a big ugly workaround but I'd rather figure out how to properly
escape these chars!

-Robert Goodyear


--- Howard Cheng <howcheng at ix.netcom.com> wrote:
> Use the backslash to escape special characters, including parentheses.
>
> At 04:08 PM 3/8/2002 -0800, Robert Goodyear wrote:
> >I'm having some trouble escaping the left and right parenthesis characters
> >when
> >building a Regular Expression.
> >
> >I'm using UltraEdit32, and its syntax claims that I should use ^ to escape
> >special characters, but I'm having no luck. Anyone come across this one?
>


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/



More information about the thelist mailing list