I want___DATA___ #Pattern 1 - aaa <anything> bbb <anything> ccc <whitespaces> dddd aaa xxxxxxx bbb ccc dddd ------------------------------------- # Pattern 2 - aaa <anything> bbb <anything> ccc <whitespaces> dddd aaa xxxxxxxxxxxxxxxxxxxxx xxxxxxx bbb xxxxxxxxxxxxxxxxxxxxx xxxx xx ccc dddd
to give me 2. But it gives me 1. I assume that the culprut is .* Any way to get around this?print $#{[$lines =~ /aaa.*bbb.*ccc\s*dddd/gsi]} + 1 . "\n";
In reply to regex matches more than I want by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |