use warnings; use strict; while (<DATA>) { if (/^[a-z]+\s+\d{2}$/i) { print "PASS $_"; } else { print "FAIL $_"; } } __DATA__ xyz 12 45 xyz 123 xyz 12
outputs:
FAIL xyz 12 45 FAIL xyz 123 PASS xyz 12
In reply to Re^3: Help with regular expression
by toolic
in thread Help with regular expression
by heman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |