in reply to Regex AND
But you could use regex::assemble to do(?!regex1)(?!regex2)(?!regex3)
and then do a negative lookahead on that. I'm not sure of the quoting syntax here though.my $andedRegexes = Regexp::Assemble->new; $andedRegexes->add( 'regex1' ); $andedRegexes->add( 'regex2' ); $andedRegexes->add( 'regex3' ); #regex is now 'regex(1|2|3)' #which is more efficient
Actually I'm pretty sure that's wrong syntax. But you get the idea.$negatedAndedRegexes = (?=qr($andedRegexes))
(Could someone correct that?)
Hope this helps!
Thomas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Actually, regex::assemble would help!
by ady (Deacon) on Dec 04, 2004 at 12:56 UTC |