in reply to Re: regex elegance contest - validate a pw
in thread regex elegance contest - validate a pw
Well, isn't \w also locale aware?
Example: (Germany)
% perl -e 'use locale; $_=q{äöü}; print qq{Locale aware!\n} if /^\w+$/ +;'
Results in:
Locale aware!
Thus, \w is bad when you really mean /[A-Za-z0-9]/. On the other hand, using the latter character class instead of \w is usually more of a problem for most applications. The best example is, I daresay, entering my last name in some form on the web that does this: Müller ;-)
Steffen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: regex elegance contest - validate a pw
by leriksen (Curate) on Feb 13, 2004 at 01:11 UTC | |
by mildside (Friar) on Feb 13, 2004 at 02:21 UTC |