Welcome to the Monastery | |
PerlMonks |
Re: RegEx Beginning of line or whitespace matchby gaal (Parson) |
on Feb 11, 2005 at 21:35 UTC ( [id://430297]=note: print w/replies, xml ) | Need Help?? |
/^\s*for\(/
This matches if the "for(" has no characters at all before it (== at beginning of line) or if there are whitespace characters. You were missing the anchor, I think.
In Section
Seekers of Perl Wisdom
|
|