in reply to Re^5: regex basics
in thread regex basics
! $_ =~ /;\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: <%-(-(-(-<
|
|---|