Shouldn't that be
m/ \A (?: [[:alpha:][:digit:]] [[:alpha:][:digit:]-]* )? \z /x
Your version requires that at least one character be present.
In reply to Re^2: Regular Expression - Need HElp..pls
by ikegami
in thread Regular Expression - Need HElp..pls
by dani_cv_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |