Hi, simple try this
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
In reply to Re: RegEx Beginning of line or whitespace match
by Anonymous Monk
in thread RegEx Beginning of line or whitespace match
by THRAK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |