in reply to Need regex to check for disallowed characters
if ($input =~ m/^[A-Za-z]*\s{0,1}[A-Za-z]*$/) { print "match!\n"; } else { print "no match!\n"; }
Now this may not be exactly what are you testing for (i.e. you might want to exclude leading or trailing spaces), but this gives you something to work with. I'll leave the rest up to you and you need help with that, just holler...
|
|---|