use strict; use diagnostics; my @line = ( 'some_for($var)', #don't match ' for($var)', #match 'for($var)', #match ); for ( @line ) { print /(^(\s+)?)for\(/gi ? "match\n" : "nomatch\n"; }
In reply to Re: RegEx Beginning of line or whitespace match
by holli
in thread RegEx Beginning of line or whitespace match
by THRAK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |