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.
In reply to Re: Stumped by regex
by reasonablekeith
in thread Stumped by regex
by brickwall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |