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

Re: Need a regex..

by ikegami (Pope)
on May 22, 2012 at 20:18 UTC ( #971867=note: print w/ replies, xml ) Need Help??


in reply to Need a regex..

It's unclear what you want.

If you're trying to match «a string that isn't "Select"», you want

$s !~ /^Select\z/

If you're trying to match «a string that doesn't contain "Select"», you want

$s !~ /Select/

If you're trying to match «any number of characters that don't contain the substring "Select"», you want

$s =~ /(?:(?!Select).)*/s

(This last one would normally be used as part of a larger pattern.)


/(?:(?!STRING).)*/s
is to
/STRING/
as
/[^CHAR]/
is to
/CHAR/


Comment on Re: Need a regex..
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-09-21 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (175 votes), past polls