- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

13.2.2 Word characters

A \w matches a single alphanumeric character (an alphabetic character, or a decimal digit) or an underscore (_), not a whole word. Use \w+ to match a string of Perl-identifier characters (which isn't the same as matching an English word). What is considered a word character depends on the internal encoding of the string and the locale or EBCDIC code page that is in effect. If it's in UTF-8 format, \w matches those characters that are considered word characters in the Unicode database. That is, it not only matches ASCII letters, but also Thai letters, Greek letters, etc. If the source string isn't in UTF-8 format, \w matches those characters that are considered word characters by the current locale or EBCDIC code page. Without a locale or EBCDIC code page, \w matches the ASCII letters, digits and the underscore. See 13.4.

Any character that isn't matched by \w will be matched by \W.

ISBN 9781906966027Perl Language Reference ManualSee the print edition