use warnings; use strict; while (<DATA>) { chomp; if (/ ^ [cljso] \d{4} _ \d*? \. (dat|idx) $ /ix) { print "$_ : match\n"; } else { print "$_ : no match\n"; } } __DATA__ C1234ABC.IDX C1234_ABC.IDX C1234_.IDX
prints:
C1234ABC.IDX : no match C1234_ABC.IDX : no match C1234_.IDX : match
In reply to Re: Regular Expression Assistance
by toolic
in thread Regular Expression Assistance
by jaacmmason
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |