DEVFYI - Developer Resource - FYI

How do you match one letter in the current locale?

Perl Questions and Answers


(Continued from previous question...)

How do you match one letter in the current locale?

/[^\W_\d]/
We don't have full POSIX regexps, so you can't get at the isalpha() <ctype.h> macro save indirectly. You ask for one byte which is neither a non-alphanumunder, nor an under, nor a numeric. That leaves just the alphas, which is what you want.

(Continued on next question...)

Other Interview Questions