in reply to RegEx Beginning of line or whitespace match
Hi try this simple
use strict; use diagnostics; my $line = 'some_for($var)'; #don't match $line = ' for($var)'; #match $line = 'for($var)'; #match if($line =~ m#^(\s+)?for\(#si) { print "Match"; } else { print "Non-match"; }
Gubendran.L
|
|---|