in reply to Problem with negative lookahead at end of string

For simplicity sake, you can list a compound "and-ed" condition as a series of null assertions:
/ ^ # anchor so as not to try this at every spot (?= chars ) # stars with chars (?= .*? this ) # contains this (?! .*? that ) # does not contain that (?! .* whatever $ ) # does not end in whatever /xs

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

update: edited to include additional whitespace for readability

Replies are listed 'Best First'.
Re^2: Problem with negative lookahead at end of string
by melora (Scribe) on Jun 21, 2004 at 17:35 UTC
    Nice. "I'd walk a mile for a (Programming Perl) Camel." Had to reach for it to get through that ?!.*? regex! I'm just an old C programmer, learning more than one way to do it...