Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Regex negative word

by unobe (Scribe)
on Apr 02, 2006 at 04:15 UTC ( #540701=note: print w/replies, xml ) Need Help??


in reply to Regex negative word

Just for fun, I decided to try using (?(cond)ptrue[|pfalse]) , a regexp feature I learned just yesterday while reading the Perl Pocket Reference. However, reading perldoc perlre, I noted something the Perl Pocket Reference didn't: this feature is "highly experimental". That's probably why it wasn't used by anyone in the first place. Since this isn't in the first place, no harm done. :-)
/^(?(?!cat).*\bdog)$/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://540701]
help
Chatterbox?
[Corion]: First World Problems - on my new desk, the sun shines in my face :)
[LanX]: damn sun ...blame Ophelia!
[choroba]: Yesterday, I gave Ramirez a headshot through the gate in Aztec. LOL. What happened to you? WTF? Sun. There was a hole in the window foil.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2017-10-18 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (245 votes). Check out past polls.

    Notices?