PHP Reference Book Blog

PHP Reference: Beginner to Intermediate PHP5

May-30-08

RegEx PERL Compatible Character Class \w

posted by Mario Lurig

(pg. 150)

Book version:

\w - Letter (a-z, A-Z)

Correct version:

\w - Letter, Digit, Underscore [a-zA-Z0-9_]

This is similar to the syntax for alphanumeric: [:alnum:]