in reply to Re^2: RegEx Beginning of line or whitespace match
in thread RegEx Beginning of line or whitespace match

In other words: match if for( begins at a word boundary, don't match in all other cases:
m/\b(for\()/
PS: you can drop the parentheses if you don't want to extract anything and only want to test for matches.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law