or
... if ($test_string !~ /$regex/) { ... } ... [download]
Perl operators and their precedence
In reply to Re^2: regular expressions with ! by ikegami in thread regular expressions with ! by egunnar