Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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.)

is to
is to

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971867]
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: (5)
As of 2015-11-26 09:41 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls