Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 browsing the Monastery: (5)
As of 2015-07-08 02:42 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 (93 votes), past polls