in reply to Re: Re: regex elegance contest - validate a pw
in thread regex elegance contest - validate a pw

I think it is also Unicode aware in 5.8+ so that introduces all sorts of variation - if Unicode is supported, \w usually refers to all alphanumberics - in fact you might see \w start to die out and things like unicode properties appear

$word = m/([\p{Letter}\p{Number}]+)/;

I think that is correct...

I know that in Java's regex package, \w == \A-Za-z0-9_\ only

I got most of this info from Friedl's Mastering Regular Expressions - if you dont own it - buy it and read it from chapters 1-7 - it is truely excellent, a standout book.

+++++++++++++++++
#!/usr/bin/perl
use warnings;use strict;use brain;

Replies are listed 'Best First'.
Re: Re: Re: Re: regex elegance contest - validate a pw
by mildside (Friar) on Feb 13, 2004 at 02:21 UTC
    leriksen says:
    ... Friedl's Mastering Regular Expressions - if you dont own it - buy it ...
    Yeah leriksen, perhaps you should take your own advice and buy a copy. That way I could have my copy back! :-)

    Cheers!