- 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.4 Unicode Properties

\pP and \p{Prop} are character classes to match characters that fit given Unicode properties. One letter property names can be used in the \pP form, with the property name following the \p, otherwise, braces are required. When using braces, there is a single form, which is just the property name enclosed in the braces, and a compound form which looks like \p{name=value}, which means to match if the property "name" for the character has the particular "value". For instance, a match for a number can be written as /\pN/ or as /\p{Number}/, or as /\p{Number=True}/. Lowercase letters are matched by the property Lowercase_Letter which has as short form Ll. They need the braces, so are written as /\p{Ll}/ or /\p{Lowercase_Letter}/, or /\p{General_Category=Lowercase_Letter}/ (the underscores are optional). /\pLl/ is valid, but means something different. It matches a two character string: a letter (Unicode property \pL), followed by a lowercase l.

For more details, see "Unicode Character Properties" (perlunicode) in the Perl Unicode and Locales Manual; for a complete list of possible properties, see "Properties accessible through \p{} and \P{}" (perluniprops) in the Perl Unicode and Locales Manual. It is also possible to define your own properties. This is discussed in "User-Defined Character Properties" (perlunicode) in the Perl Unicode and Locales Manual.

ISBN 9781906966027Perl Language Reference ManualSee the print edition