in reply to Re^2: Help with regular expression
in thread Help with regular expression
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Help with regular expression
by heman (Novice) on Nov 13, 2014 at 02:42 UTC |