On Sat, Sep 15, 2018 at 06:37:34PM -0700, ToddAndMargo wrote:
: Hi All,
: 
: \L
: \N

I don't really know what you mean by those.

Regex switches are things like :i for case insensitivity.  They're also
called regex modifiers or regex options.  They always start with colon.
Something with a backslash is never called a switch in Perl culture.

: Since I use them all the time and there is a big long list of them
: over on
: 
: 
: 
https://docs.perl6.org/language/regexes#index-entry-regex_%3C%3Aproperty%3E-Unicode_properties
: 
: it is about time I know their "Official" name?  I presume
: "regex switches" is not their official name.

You will note that that's in the section entitled "Unicode properties",
which seems like a pretty good name to me.  However, you're apparently
misconstruing their syntax.  \L and \N are not Unicode properties.
These are always used inside single angles plus a colon:

    <:L>  A letter
    <:N>  A number

Do not confuse these with any of:

    \L  (Error: Unrecognized backslash sequence)
    \N  A character that doesn't match a \n

    :L  (Error: Unrecognized regex modifier)
    :N  (Error: Unrecognized regex modifier)

    <L>  (Error: No such method 'L' for invocant of type 'Match')
    <N>  (Error: No such method 'N' for invocant of type 'Match')

More generally, Unicode properties like <:L> are a subset of character classes.
Character classes are always inside angles in Perl 6, and inside those
angles, you can combine Unicode properties and enumerated character classes:

    <:L + :N + [_]>   A letter or a number or an underscore
    <alnum>           Same thing
    \w                Same thing
    
Well, okay, I lied, since \w is a character class that is not inside angles.  :)

Larry

Reply via email to