Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: AND and OR on Regular Expressions

by busunsl (Vicar)
on Aug 25, 2009 at 14:07 UTC ( #791084=note: print w/ replies, xml ) Need Help??


in reply to AND and OR on Regular Expressions

I think the easiest way to handle ANDs is using multiple regexen:
if (/olive/ and /popeye|bluto/) { }
But if you know the order of appearance (i.e. olive before popeye) you can use:
/olive.*(popeye|bluto)/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://791084]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2016-06-25 03:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (323 votes). Check out past polls.