in reply to Re^2: Stumped by regex
in thread Stumped by regex
yup, dumb mistake by me. Also though, I assumed there was a first name here too. So the above regex allows an additional space that it shouldn't. You're probably okay with just the following...
...although this does force a minimum length of 2.$name =~ m/^[a-z]+\s?[a-z]+$/i
Having said this, if I'd seen JediWizard's reply, I wouldn't have posted mine. I think he nailed it first time (++).
---
my name's not Keith, and I'm not reasonable.
my name's not Keith, and I'm not reasonable.
In Section
Seekers of Perl Wisdom