I have changed a couple of things,but I mainly I think it is clearer if you have \s* instead of (\s+)? and use the \x so that when you look back at this latter you have an idea of what each part of this regex does.use strict; my $x='Mr. Popcorn Dave'; print "Name valid\n" if m/^\s* #ZERO OR MORE SPACES (M(s|rs?|iss)\.?\s+)? #POSS SALUTATION [A-Z]+\.?\s+ #NAME AFTER SAL. [A-Z]+ #2nd NAME \s*([A-Z]+\s*)?$/ix; #SUFFIX
In reply to Re: Untainting name data from form
by Enlil
in thread Untainting name data from form
by Popcorn Dave
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |