in reply to Stumped by regex
UPDATE: See replies....
if (length($name) <= 20 and $name =~ m/^\w+\s(\w+\s)?\w+$/i) { print "okay\n"; }
By the way, your character restriction doesn't work because you can match up to three characters in one go within the parentheses, so your upper limit here is actually 60.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Stumped by regex
by brickwall (Acolyte) on Dec 06, 2006 at 15:18 UTC | |
by reasonablekeith (Deacon) on Dec 06, 2006 at 15:25 UTC | |
by Fletch (Bishop) on Dec 06, 2006 at 15:32 UTC | |
by OfficeLinebacker (Chaplain) on Dec 06, 2006 at 16:19 UTC |