Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

•Re: Problem with negative lookahead at end of string

by merlyn (Sage)
on Jun 21, 2004 at 11:45 UTC ( [id://368483]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 13: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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://368483]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.