http://www.perlmonks.org?node_id=971867


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/