View Single Post

  #10 (permalink)  
Old 10-30-2006
Pedro Graca
 
Posts: n/a
Default Re: Help me with a regular expression for PHP

Chung Leong wrote:
> \w is equivalent to [_a-zA-Z0-9] by the way.


It is /almost/ equivalent:

~$ php -r 'echo (preg_match("/^\w+$/", "Graça"))?("yes"):("no"), "\n";'
yes
~$ php -r 'echo (preg_match("/^[_a-zA-Z0-9]+$/", "Graça"))?("yes"):("no"), "\n";'
no

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Reply With Quote