! $_ =~ /;\s+/;
Because of the high precedence of the ! (logical-not) operator versus =~ (see perlop), the regex actually matches against either '' (the empty string) or '1'.
These are equivalent:c:\@Work\Perl>perl -wMstrict -MO=Deparse,-p -le "! $_ =~ /;\s+/; " BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } use strict 'refs'; ((!$_) =~ /;\s+/); -e syntax OK
! ($_ =~ /;\s+/); # or $_ !~ /;\s+/;
Give a man a fish: <%-(-(-(-<
In reply to Re^6: regex basics
by AnomalousMonk
in thread regex basics
by jott19
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |