Dave's exactly right! So, I'll recommend and explain something which combines our methods ...
/^[:alpha:][[:alpha:]\d-]*\z/I favor one-liners, but that's just a style preference. I changed my \w to [:alpha:], my ^ to \A, and my $ to \z per davido's recommendation, but I stuck with the \d because it's shorter and still works in this case. I left off the m at the beginning because that's the default anyway. I left off the x at the end because this regex doesn't use extended patterns (ref: Extended Patterns).
-- -- GhodMode
In reply to Re^3: Regular Expression - Need HElp..pls
by GhodMode
in thread Regular Expression - Need HElp..pls
by dani_cv_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |