Unless you can assume that the 2 chars will never be at the beginning of the line, in which case you can just do:if ( $line =~ /^\S/ && $line =~ /XY/ ){ ... }
if ( $line =~ /^\S.*?XY/ ){ ... }
In reply to Re^2: Negating a leading whitespace
by davidrw
in thread Negating a leading whitespace
by icg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |