Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Single regex

by BrowserUk (Pope)
on Jan 10, 2013 at 16:57 UTC ( #1012702=note: print w/ replies, xml ) Need Help??


in reply to Single regex

print "$_: ", m[[nl]tv\.(?:com\.wid-prl\.)?com/(?:business|very-own)/] + ? 'matches' : 'nomatch' for qw[ ntv.com/very-own/ ntv.com/business/ ntv.com.wid-prl.com/very-own/ ltv.com/very-own/ ];; ntv.com/very-own/: matches ntv.com/business/: matches ntv.com.wid-prl.com/very-own/: matches ltv.com/very-own/: matches

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Single regex
Download Code
Re^2: Single regex
by 0day (Sexton) on Jan 10, 2013 at 17:17 UTC
    good code, but I would add ^ and $
    m[^[nl]tv\.(?:com\.wid-prl\.)?com/(?:business|very-own)/$]

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2015-07-04 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls