[ale] Yet another regex question

Geoffrey esoteric at 3times25.net
Sat Aug 13 10:50:44 EDT 2005


Christopher Fowler wrote:
> I'm trying to create a regex that will catch only the string 'ABCDEF'
> If the string is '% ABCDEF' I do not want the POSIX regex engine to
> catch.  Is there a way I can create a regex that will ignore 'ABCDEF' if
> it it preceeded with a '%\s'?  The \s is a space.

I guess it might depend on the bigger picture of what you're trying to 
do.  I assume ABCDEF is just an example.   Do you want to exlude 
ANYTHING that is prefixed by '% ' ?

If so, you could simply do something like this in perl in the context of 
a loop:

/^% / && next;


that's assuming it's starting a line.

My point is, I don't know that you've provided enough info regarding 
what you're actually trying to accomplish.

-- 
Until later, Geoffrey



More information about the Ale mailing list