diotalevi has asked for the wisdom of the Perl Monks concerning the following question:

perlre

\pP Match P, named property. Use \p{Prop} for longer names.
What the heck is a named property? I grepped the 5.8.0 and 5.8.1-RC2 source and found no mention of this except for the one line in perlre. The following snippet indicates it has something to do with unicode but there's no other reference to this.

perl -Mre=debug -e 'qr/\p{something}/'

Produces:

Freeing REx: `","' Compiling REx `\p{something}' size 12 Got 100 bytes for offset annotations. first at 1 1: ANYOF[{unicode}+utf8::something](12) 12: END(0) stclass `ANYOF[{unicode}+utf8::something]' minlen 1 Offsets: [12] 0[11] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 14[0] Omitting $` $& $' support. EXECUTING... Freeing REx: `"\\p{something}"'

Replies are listed 'Best First'.
(jeffa) Re: What is a 'named property'? (perlre)
by jeffa (Bishop) on Jul 15, 2003 at 16:31 UTC
    In over my head here, but searching further down in perlre:
    POSIX trad. Perl utf8 Perl [:^digit:] \D \P{IsDigit} [:^space:] \S \P{IsSpace} [:^word:] \W \P{IsWord}
    and also:
    See the utf8 manpage for details about `\pP', `\PP', and `\X'.
    update: searching in the perlunicode manpage yields:
    · Named Unicode properties and block ranges make be used as character classes via the new `\p{}' (matches property) and `\P{}' (doesn't match property) constructs. For instance, `\p{Lu}' matches any character with the Unicode uppercase property, while `\p{M}' matches any mark character. Single letter properties may omit the brackets, so that can be written `\pM' also. Many predefined character classes are available, such as `\p{IsMirrored}' and `\p{InTibetan}'.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: What is a 'named property'? (perlre)
by broquaint (Abbot) on Jul 15, 2003 at 16:32 UTC
    From the perlunicode manpage
    Named Unicode properties and block ranges make be used as character classes via the new "\p{}" (matches property) and "\P{}" (doesn't match property) constructs. For instance, "\p{Lu}" matches any character with the Unicode uppercase property, while "\p{M}" matches any mark character. Single letter properties may omit the brackets, so that can be written "\pM" also. Many predefined character classes are available, such as "\p{IsMirrored}" and "\p{InTibetan}".
    There ya have it :)
    HTH

    _________
    broquaint

      Oh I see. I did `grep -r 'named property'`, not `grep -ri 'named property'`. Yet another PEBKAC issue.