{
    "content": [
        {
            "type": "text",
            "text": "# perlrecharclass (man)\n\n## NAME\n\nperlrecharclass - Perl Regular Expression Character Classes\n\n## DESCRIPTION\n\nThe top level documentation about Perl regular expressions is found in perlre.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION** (3 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "perlrecharclass",
        "section": "",
        "mode": "man",
        "summary": "perlrecharclass - Perl Regular Expression Character Classes",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 15,
                "subsections": [
                    {
                        "name": "The dot",
                        "lines": 17
                    },
                    {
                        "name": "Backslash sequences",
                        "lines": 296
                    },
                    {
                        "name": "Bracketed Character Classes",
                        "lines": 610
                    }
                ]
            }
        ],
        "sections": {
            "NAME": {
                "content": "perlrecharclass - Perl Regular Expression Character Classes\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The top level documentation about Perl regular expressions is found in perlre.\n\nThis manual page discusses the syntax and use of character classes in Perl regular\nexpressions.\n\nA character class is a way of denoting a set of characters in such a way that one character\nof the set is matched.  It's important to remember that: matching a character class consumes\nexactly one character in the source string. (The source string is the string the regular\nexpression is matched against.)\n\nThere are three types of character classes in Perl regular expressions: the dot, backslash\nsequences, and the form enclosed in square brackets.  Keep in mind, though, that often the\nterm \"character class\" is used to mean just the bracketed form.  Certainly, most Perl\ndocumentation does that.\n",
                "subsections": [
                    {
                        "name": "The dot",
                        "content": "The dot (or period), \".\" is probably the most used, and certainly the most well-known\ncharacter class. By default, a dot matches any character, except for the newline. That\ndefault can be changed to add matching the newline by using the single line modifier: for the\nentire regular expression with the \"/s\" modifier, or locally with \"(?s)\"  (and even globally\nwithin the scope of \"use re '/s'\").  (The \"\\N\" backslash sequence, described below, matches\nany character except newline without regard to the single line modifier.)\n\nHere are some examples:\n\n\"a\"  =~  /./       # Match\n\".\"  =~  /./       # Match\n\"\"   =~  /./       # No match (dot has to match a character)\n\"\\n\" =~  /./       # No match (dot does not match a newline)\n\"\\n\" =~  /./s      # Match (global 'single line' modifier)\n\"\\n\" =~  /(?s:.)/  # Match (local 'single line' modifier)\n\"ab\" =~  /^.$/     # No match (dot matches one character)\n"
                    },
                    {
                        "name": "Backslash sequences",
                        "content": "A backslash sequence is a sequence of characters, the first one of which is a backslash.\nPerl ascribes special meaning to many such sequences, and some of these are character\nclasses.  That is, they match a single character each, provided that the character belongs to\nthe specific set of characters defined by the sequence.\n\nHere's a list of the backslash sequences that are character classes.  They are discussed in\nmore detail below.  (For the backslash sequences that aren't character classes, see\nperlrebackslash.)\n\n\\d             Match a decimal digit character.\n\\D             Match a non-decimal-digit character.\n\\w             Match a \"word\" character.\n\\W             Match a non-\"word\" character.\n\\s             Match a whitespace character.\n\\S             Match a non-whitespace character.\n\\h             Match a horizontal whitespace character.\n\\H             Match a character that isn't horizontal whitespace.\n\\v             Match a vertical whitespace character.\n\\V             Match a character that isn't vertical whitespace.\n\\N             Match a character that isn't a newline.\n\\pP, \\p{Prop}  Match a character that has the given Unicode property.\n\\PP, \\P{Prop}  Match a character that doesn't have the Unicode property\n\n\\N\n\n\"\\N\", available starting in v5.12, like the dot, matches any character that is not a newline.\nThe difference is that \"\\N\" is not influenced by the single line regular expression modifier\n(see \"The dot\" above).  Note that the form \"\\N{...}\" may mean something completely different.\nWhen the \"{...}\" is a quantifier, it means to match a non-newline character that many times.\nFor example, \"\\N{3}\" means to match 3 non-newlines; \"\\N{5,}\" means to match 5 or more non-\nnewlines.  But if \"{...}\" is not a legal quantifier, it is presumed to be a named character.\nSee charnames for those.  For example, none of \"\\N{COLON}\", \"\\N{4F}\", and \"\\N{F4}\" contain\nlegal quantifiers, so Perl will try to find characters whose names are respectively \"COLON\",\n\"4F\", and \"F4\".\n\nDigits\n\n\"\\d\" matches a single character considered to be a decimal digit.  If the \"/a\" regular\nexpression modifier is in effect, it matches [0-9].  Otherwise, it matches anything that is\nmatched by \"\\p{Digit}\", which includes [0-9].  (An unlikely possible exception is that under\nlocale matching rules, the current locale might not have \"[0-9]\" matched by \"\\d\", and/or\nmight match other characters whose code point is less than 256.  The only such locale\ndefinitions that are legal would be to match \"[0-9]\" plus another set of 10 consecutive digit\ncharacters;  anything else would be in violation of the C language standard, but Perl doesn't\ncurrently assume anything in regard to this.)\n\nWhat this means is that unless the \"/a\" modifier is in effect \"\\d\" not only matches the\ndigits '0' - '9', but also Arabic, Devanagari, and digits from other languages.  This may\ncause some confusion, and some security issues.\n\nSome digits that \"\\d\" matches look like some of the [0-9] ones, but have different values.\nFor example, BENGALI DIGIT FOUR (U+09EA) looks very much like an ASCII DIGIT EIGHT (U+0038),\nand LEPCHA DIGIT SIX (U+1C46) looks very much like an ASCII DIGIT FIVE (U+0035).  An\napplication that is expecting only the ASCII digits might be misled, or if the match is\n\"\\d+\", the matched string might contain a mixture of digits from different writing systems\nthat look like they signify a number different than they actually do.  \"num()\" in\nUnicode::UCD can be used to safely calculate the value, returning \"undef\" if the input string\ncontains such a mixture.  Otherwise, for example, a displayed price might be deliberately\ndifferent than it appears.\n\nWhat \"\\p{Digit}\" means (and hence \"\\d\" except under the \"/a\" modifier) is\n\"\\p{GeneralCategory=DecimalNumber}\", or synonymously, \"\\p{GeneralCategory=Digit}\".\nStarting with Unicode version 4.1, this is the same set of characters matched by\n\"\\p{NumericType=Decimal}\".  But Unicode also has a different property with a similar name,\n\"\\p{NumericType=Digit}\", which matches a completely different set of characters.  These\ncharacters are things such as \"CIRCLED DIGIT ONE\" or subscripts, or are from writing systems\nthat lack all ten digits.\n\nThe design intent is for \"\\d\" to exactly match the set of characters that can safely be used\nwith \"normal\" big-endian positional decimal syntax, where, for example 123 means one\n'hundred', plus two 'tens', plus three 'ones'.  This positional notation does not necessarily\napply to characters that match the other type of \"digit\", \"\\p{NumericType=Digit}\", and so\n\"\\d\" doesn't match them.\n\nThe Tamil digits (U+0BE6 - U+0BEF) can also legally be used in old-style Tamil numbers in\nwhich they would appear no more than one in a row, separated by characters that mean \"times\n10\", \"times 100\", etc.  (See <https://www.unicode.org/notes/tn21>.)\n\nAny character not matched by \"\\d\" is matched by \"\\D\".\n\nWord characters\n\nA \"\\w\" matches a single alphanumeric character (an alphabetic character, or a decimal digit);\nor a connecting punctuation character, such as an underscore (\"\"); or a \"mark\" character\n(like some sort of accent) that attaches to one of those.  It does not match a whole word.\nTo match a whole word, use \"\\w+\".  This isn't the same thing as matching an English word, but\nin the ASCII range it is the same as a string of Perl-identifier characters.\n\nIf the \"/a\" modifier is in effect ...\n\"\\w\" matches the 63 characters [a-zA-Z0-9].\n\notherwise ...\nFor code points above 255 ...\n\"\\w\"  matches the same as \"\\p{Word}\" matches in this range.  That is, it matches Thai\nletters,  Greek  letters,  etc.   This  includes  connector  punctuation  (like   the\nunderscore)  which  connect  two  words together, or diacritics, such as a \"COMBINING\nTILDE\" and the modifier letters, which are generally used to add  auxiliary  markings\nto letters.\n\nFor code points below 256 ...\nif locale rules are in effect ...\n\"\\w\"  matches the platform's native underscore character plus whatever the locale\nconsiders to be alphanumeric.\n\nif, instead, Unicode rules are in effect ...\n\"\\w\" matches exactly what \"\\p{Word}\" matches.\n\notherwise ...\n\"\\w\" matches [a-zA-Z0-9].\n\nWhich rules apply are determined as described in \"Which character set modifier is in effect?\"\nin perlre.\n\nThere are a number of security issues with the full Unicode list  of  word  characters.   See\n<http://unicode.org/reports/tr36>.\n\nAlso,  for  a  somewhat  finer-grained  set  of  characters  that are in programming language\nidentifiers beyond the ASCII range, you may wish to instead use the more customized  \"Unicode\nProperties\", \"\\p{IDStart}\", \"\\p{IDContinue}\", \"\\p{XIDStart}\", and \"\\p{XIDContinue}\".  See\n<http://unicode.org/reports/tr31>.\n\nAny character not matched by \"\\w\" is matched by \"\\W\".\n\nWhitespace\n\n\"\\s\" matches any single character considered whitespace.\n\nIf the \"/a\" modifier is in effect ...\nIn  all Perl versions, \"\\s\" matches the 5 characters [\\t\\n\\f\\r ]; that is, the horizontal\ntab, the newline, the form feed, the carriage return, and the space.   Starting  in  Perl\nv5.18, it also matches the vertical tab, \"\\cK\".  See note \"[1]\" below for a discussion of\nthis.\n\notherwise ...\nFor code points above 255 ...\n\"\\s\"  matches exactly the code points above 255 shown with an \"s\" column in the table\nbelow.\n\nFor code points below 256 ...\nif locale rules are in effect ...\n\"\\s\" matches whatever the locale considers to be whitespace.\n\nif, instead, Unicode rules are in effect ...\n\"\\s\" matches exactly the characters shown with an \"s\" column in the table below.\n\notherwise ...\n\"\\s\" matches [\\t\\n\\f\\r ] and, starting in Perl v5.18, the  vertical  tab,  \"\\cK\".\n(See  note  \"[1]\"  below  for a discussion of this.)  Note that this list doesn't\ninclude the non-breaking space.\n\nWhich rules apply are determined as described in \"Which character set modifier is in effect?\"\nin perlre.\n\nAny character not matched by \"\\s\" is matched by \"\\S\".\n\n\"\\h\" matches any character considered horizontal whitespace;  this  includes  the  platform's\nspace  and  tab  characters  and  several others listed in the table below.  \"\\H\" matches any\ncharacter not considered horizontal whitespace.  They use  the  platform's  native  character\nset, and do not consider any locale that may otherwise be in use.\n\n\"\\v\"  matches  any  character  considered  vertical  whitespace; this includes the platform's\ncarriage return and line feed characters (newline) plus several other characters, all  listed\nin the table below.  \"\\V\" matches any character not considered vertical whitespace.  They use\nthe  platform's native character set, and do not consider any locale that may otherwise be in\nuse.\n\n\"\\R\" matches anything that can be considered a newline under Unicode rules. It  can  match  a\nmulti-character  sequence.  It  cannot  be  used inside a bracketed character class; use \"\\v\"\ninstead (vertical whitespace).  It uses the platform's native character  set,  and  does  not\nconsider any locale that may otherwise be in use.  Details are discussed in perlrebackslash.\n\nNote  that  unlike  \"\\s\" (and \"\\d\" and \"\\w\"), \"\\h\" and \"\\v\" always match the same characters,\nwithout regard to other factors, such as the active locale or whether the source string is in\nUTF-8 format.\n\nOne might think that \"\\s\" is equivalent to \"[\\h\\v]\". This is indeed  true  starting  in  Perl\nv5.18,  but  prior  to  that,  the  sole difference was that the vertical tab (\"\\cK\") was not\nmatched by \"\\s\".\n\nThe following table is a complete listing of characters matched by \"\\s\", \"\\h\" and \"\\v\" as  of\nUnicode 14.0.\n\nThe  first  column  gives the Unicode code point of the character (in hex format), the second\ncolumn gives the (Unicode) name. The third column indicates by which class(es) the  character\nis matched (assuming no locale is in effect that changes the \"\\s\" matching).\n\n0x0009        CHARACTER TABULATION   h s\n0x000a              LINE FEED (LF)    vs\n0x000b             LINE TABULATION    vs  [1]\n0x000c              FORM FEED (FF)    vs\n0x000d        CARRIAGE RETURN (CR)    vs\n0x0020                       SPACE   h s\n0x0085             NEXT LINE (NEL)    vs  [2]\n0x00a0              NO-BREAK SPACE   h s  [2]\n0x1680            OGHAM SPACE MARK   h s\n0x2000                     EN QUAD   h s\n0x2001                     EM QUAD   h s\n0x2002                    EN SPACE   h s\n0x2003                    EM SPACE   h s\n0x2004          THREE-PER-EM SPACE   h s\n0x2005           FOUR-PER-EM SPACE   h s\n0x2006            SIX-PER-EM SPACE   h s\n0x2007                FIGURE SPACE   h s\n0x2008           PUNCTUATION SPACE   h s\n0x2009                  THIN SPACE   h s\n0x200a                  HAIR SPACE   h s\n0x2028              LINE SEPARATOR    vs\n0x2029         PARAGRAPH SEPARATOR    vs\n0x202f       NARROW NO-BREAK SPACE   h s\n0x205f   MEDIUM MATHEMATICAL SPACE   h s\n0x3000           IDEOGRAPHIC SPACE   h s\n\n[1] Prior to Perl v5.18, \"\\s\" did not match the vertical tab.  \"[^\\S\\cK]\" (obscurely) matches\nwhat \"\\s\" traditionally did.\n\n[2] NEXT  LINE and NO-BREAK SPACE may or may not match \"\\s\" depending on the rules in effect.\nSee the beginning of this section.\n\nUnicode Properties\n\n\"\\pP\" and \"\\p{Prop}\" are character  classes  to  match  characters  that  fit  given  Unicode\nproperties.   One letter property names can be used in the \"\\pP\" form, with the property name\nfollowing the \"\\p\", otherwise, braces are required.  When using braces,  there  is  a  single\nform, which is just the property name enclosed in the braces, and a compound form which looks\nlike \"\\p{name=value}\", which means to match if the property \"name\" for the character has that\nparticular  \"value\".   For  instance,  a  match  for a number can be written as \"/\\pN/\" or as\n\"/\\p{Number}/\", or as \"/\\p{Number=True}/\".  Lowercase letters are  matched  by  the  property\nLowercaseLetter  which  has  the  short  form  Ll.  They  need the braces, so are written as\n\"/\\p{Ll}/\" or  \"/\\p{LowercaseLetter}/\",  or  \"/\\p{GeneralCategory=LowercaseLetter}/\"  (the\nunderscores  are  optional).  \"/\\pLl/\" is valid, but means something different.  It matches a\ntwo character string: a letter (Unicode property \"\\pL\"), followed by a lowercase \"l\".\n\nWhat a Unicode property matches is never subject to locale rules, and if locale rules are not\notherwise in effect, the use of a Unicode property will force  the  regular  expression  into\nusing Unicode rules, if it isn't already.\n\nNote  that  almost all properties are immune to case-insensitive matching.  That is, adding a\n\"/i\" regular expression modifier does not change what they match.  But  there  are  two  sets\nthat   are   affected.    The   first  set  is  \"UppercaseLetter\",  \"LowercaseLetter\",  and\n\"TitlecaseLetter\", all of which match \"CasedLetter\" under \"/i\" matching.  The second set is\n\"Uppercase\", \"Lowercase\", and \"Titlecase\", all of which match \"Cased\"  under  \"/i\"  matching.\n(The  difference between these sets is that some things, such as Roman numerals, come in both\nupper and lower case, so they are \"Cased\", but aren't  considered  to  be  letters,  so  they\naren't  \"CasedLetter\"s.  They're  actually  \"LetterNumber\"s.)   This  set also includes its\nsubsets \"PosixUpper\" and \"PosixLower\", both of which under \"/i\" match \"PosixAlpha\".\n\nFor more details on Unicode properties, see \"Unicode Character  Properties\"  in  perlunicode;\nfor a complete list of possible properties, see \"Properties accessible through \\p{} and \\P{}\"\nin  perluniprops,  which  notes all forms that have \"/i\" differences.  It is also possible to\ndefine your own properties. This is  discussed  in  \"User-Defined  Character  Properties\"  in\nperlunicode.\n\nUnicode  properties  are defined (surprise!) only on Unicode code points.  Starting in v5.20,\nwhen matching against \"\\p\" and \"\\P\", Perl treats non-Unicode code  points  (those  above  the\nlegal Unicode maximum of 0x10FFFF) as if they were typical unassigned Unicode code points.\n\nPrior  to  v5.20, Perl raised a warning and made all matches fail on non-Unicode code points.\nThis could be somewhat surprising:\n\nchr(0x110000) =~ \\p{ASCIIHexDigit=True}     # Fails on Perls < v5.20.\nchr(0x110000) =~ \\p{ASCIIHexDigit=False}    # Also fails on Perls\n# < v5.20\n\nEven though these two matches might be thought of as complements, until v5.20  they  were  so\nonly on Unicode code points.\n\nStarting  in perl v5.30, wildcards are allowed in Unicode property values.  See \"Wildcards in\nProperty Values\" in perlunicode.\n\nExamples\n\n\"a\"  =~  /\\w/      # Match, \"a\" is a 'word' character.\n\"7\"  =~  /\\w/      # Match, \"7\" is a 'word' character as well.\n\"a\"  =~  /\\d/      # No match, \"a\" isn't a digit.\n\"7\"  =~  /\\d/      # Match, \"7\" is a digit.\n\" \"  =~  /\\s/      # Match, a space is whitespace.\n\"a\"  =~  /\\D/      # Match, \"a\" is a non-digit.\n\"7\"  =~  /\\D/      # No match, \"7\" is not a non-digit.\n\" \"  =~  /\\S/      # No match, a space is not non-whitespace.\n\n\" \"  =~  /\\h/      # Match, space is horizontal whitespace.\n\" \"  =~  /\\v/      # No match, space is not vertical whitespace.\n\"\\r\" =~  /\\v/      # Match, a return is vertical whitespace.\n\n\"a\"  =~  /\\pL/     # Match, \"a\" is a letter.\n\"a\"  =~  /\\p{Lu}/  # No match, /\\p{Lu}/ matches upper case letters.\n\n\"\\x{0e0b}\" =~ /\\p{Thai}/  # Match, \\x{0e0b} is the character\n# 'THAI CHARACTER SO SO', and that's in\n# Thai Unicode class.\n\"a\"  =~  /\\P{Lao}/ # Match, as \"a\" is not a Laotian character.\n\nIt is worth emphasizing that \"\\d\", \"\\w\", etc, match single characters, not  complete  numbers\nor words. To match a number (that consists of digits), use \"\\d+\"; to match a word, use \"\\w+\".\nBut be aware of the security considerations in doing so, as mentioned above.\n"
                    },
                    {
                        "name": "Bracketed Character Classes",
                        "content": "The  third  form  of character class you can use in Perl regular expressions is the bracketed\ncharacter class.  In its simplest  form,  it  lists  the  characters  that  may  be  matched,\nsurrounded  by square brackets, like this: \"[aeiou]\".  This matches one of \"a\", \"e\", \"i\", \"o\"\nor \"u\".  Like the other character classes, exactly one character  is  matched.*  To  match  a\nlonger string consisting of characters mentioned in the character class, follow the character\nclass  with  a  quantifier.   For  instance, \"[aeiou]+\" matches one or more lowercase English\nvowels.\n\nRepeating a character in a character class has no effect; it's considered to be  in  the  set\nonly once.\n\nExamples:\n\n\"e\"  =~  /[aeiou]/        # Match, as \"e\" is listed in the class.\n\"p\"  =~  /[aeiou]/        # No match, \"p\" is not listed in the class.\n\"ae\" =~  /^[aeiou]$/      # No match, a character class only matches\n# a single character.\n\"ae\" =~  /^[aeiou]+$/     # Match, due to the quantifier.\n\n-------\n\n*  There  are two exceptions to a bracketed character class matching a single character only.\nEach requires special handling by Perl to make things work:\n\n•   When the class is to match caselessly under \"/i\" matching rules, and a character that  is\nexplicitly  mentioned  inside  the class matches a multiple-character sequence caselessly\nunder Unicode rules, the class will also match that sequence.  For example, Unicode  says\nthat  the  letter  \"LATIN SMALL LETTER SHARP S\" should match the sequence \"ss\" under \"/i\"\nrules.  Thus,\n\n'ss' =~ /\\A\\N{LATIN SMALL LETTER SHARP S}\\z/i             # Matches\n'ss' =~ /\\A[aeioust\\N{LATIN SMALL LETTER SHARP S}]\\z/i    # Matches\n\nFor this to happen, the class must not be inverted (see  \"Negation\")  and  the  character\nmust be explicitly specified, and not be part of a multi-character range (not even as one\nof its endpoints).  (\"Character Ranges\" will be explained shortly.) Therefore,\n\n'ss' =~ /\\A[\\0-\\x{ff}]\\z/ui       # Doesn't match\n'ss' =~ /\\A[\\0-\\N{LATIN SMALL LETTER SHARP S}]\\z/ui   # No match\n'ss' =~ /\\A[\\xDF-\\xDF]\\z/ui   # Matches on ASCII platforms, since\n# \\xDF is LATIN SMALL LETTER SHARP S,\n# and the range is just a single\n# element\n\nNote that it isn't a good idea to specify these types of ranges anyway.\n\n•   Some  names known to \"\\N{...}\" refer to a sequence of multiple characters, instead of the\nusual single character.  When one of these is included in the class, the entire  sequence\nis matched.  For example,\n\n\"\\N{TAMIL LETTER KA}\\N{TAMIL VOWEL SIGN AU}\"\n=~ / ^ [\\N{TAMIL SYLLABLE KAU}]  $ /x;\n\nmatches,  because  \"\\N{TAMIL  SYLLABLE  KAU}\"  is  a named sequence consisting of the two\ncharacters matched against.  Like the other instance where a bracketed  class  can  match\nmultiple  characters,  and  for  similar reasons, the class must not be inverted, and the\nnamed sequence may not appear in a range, even one where it is both endpoints.  If  these\nhappen,  it  is  a  fatal  error  if  the  character class is within the scope of \"use re\n'strict\", or within an extended \"(?[...])\" class; otherwise only the first code point  is\nused (with a \"regexp\"-type warning raised).\n\nSpecial Characters Inside a Bracketed Character Class\n\nMost  characters  that  are  meta characters in regular expressions (that is, characters that\ncarry a special meaning like \".\", \"*\", or \"(\") lose their special meaning  and  can  be  used\ninside a character class without the need to escape them. For instance, \"[()]\" matches either\nan  opening  parenthesis, or a closing parenthesis, and the parens inside the character class\ndon't group or capture.  Be aware that, unless the pattern  is  evaluated  in  single-quotish\ncontext, variable interpolation will take place before the bracketed class is parsed:\n\n$, = \"\\t| \";\n$a =~ m'[$,]';        # single-quotish: matches '$' or ','\n$a =~ q{[$,]}'        # same\n$a =~ m/[$,]/;        # double-quotish: Because we made an\n#   assignment to $, above, this now\n#   matches \"\\t\", \"|\", or \" \"\n\nCharacters  that may carry a special meaning inside a character class are: \"\\\", \"^\", \"-\", \"[\"\nand \"]\", and are discussed below. They can be escaped with  a  backslash,  although  this  is\nsometimes not needed, in which case the backslash may be omitted.\n\nThe  sequence \"\\b\" is special inside a bracketed character class. While outside the character\nclass, \"\\b\" is an assertion indicating a point that does not have either two word  characters\nor two non-word characters on either side, inside a bracketed character class, \"\\b\" matches a\nbackspace character.\n\nThe  sequences  \"\\a\",  \"\\c\",  \"\\e\", \"\\f\", \"\\n\", \"\\N{NAME}\", \"\\N{U+hex char}\", \"\\r\", \"\\t\", and\n\"\\x\" are also special and have the same meanings as they do  outside  a  bracketed  character\nclass.\n\nAlso, a backslash followed by two or three octal digits is considered an octal number.\n\nA  \"[\"  is  not  special inside a character class, unless it's the start of a POSIX character\nclass (see \"POSIX Character Classes\" below). It normally does not need escaping.\n\nA \"]\" is normally either the end of a POSIX character class (see  \"POSIX  Character  Classes\"\nbelow), or it signals the end of the bracketed character class.  If you want to include a \"]\"\nin the set of characters, you must generally escape it.\n\nHowever,  if the \"]\" is the first (or the second if the first character is a caret) character\nof a bracketed character class, it does not denote the end of the class (as you  cannot  have\nan  empty  class) and is considered part of the set of characters that can be matched without\nescaping.\n\nExamples:\n\n\"+\"   =~ /[+?*]/     #  Match, \"+\" in a character class is not special.\n\"\\cH\" =~ /[\\b]/      #  Match, \\b inside in a character class\n#  is equivalent to a backspace.\n\"]\"   =~ /[][]/      #  Match, as the character class contains\n#  both [ and ].\n\"[]\"  =~ /[[]]/      #  Match, the pattern contains a character class\n#  containing just [, and the character class is\n#  followed by a ].\n\nBracketed Character Classes and the \"/xx\" pattern modifier\n\nNormally SPACE and TAB characters have no special meaning inside a bracketed character class;\nthey are just added to the list of characters matched by the class.  But if the \"/xx\" pattern\nmodifier is in effect, they are generally ignored and can be added  to  improve  readability.\nThey can't be added in the middle of a single construct:\n\n/ [ \\x{10 FFFF} ] /xx  # WRONG!\n\nThe SPACE in the middle of the hex constant is illegal.\n\nTo specify a literal SPACE character, you can escape it with a backslash, like:\n\n/[ a e i o u \\  ]/xx\n\nThis matches the English vowels plus the SPACE character.\n\nFor  clarity,  you  should already have been using \"\\t\" to specify a literal tab, and \"\\t\" is\nunaffected by \"/xx\".\n\nCharacter Ranges\n\nIt is not uncommon to want to match a range of characters. Luckily, instead  of  listing  all\ncharacters in the range, one may use the hyphen (\"-\").  If inside a bracketed character class\nyou  have two characters separated by a hyphen, it's treated as if all characters between the\ntwo were in the class. For instance, \"[0-9]\" matches any ASCII digit, and \"[a-m]\" matches any\nlowercase letter from the first half of the ASCII alphabet.\n\nNote that the two characters on either side of the hyphen are not necessarily both letters or\nboth digits. Any character is possible, although not advisable.  \"['-?]\" contains a range  of\ncharacters,  but  most  people  will not know which characters that means.  Furthermore, such\nranges may lead to portability problems if the code has to run on  a  platform  that  uses  a\ndifferent character set, such as EBCDIC.\n\nIf  a  hyphen  in  a  character  class  cannot syntactically be part of a range, for instance\nbecause it is the first or the last character of the character class, or  if  it  immediately\nfollows  a  range,  the  hyphen isn't special, and so is considered a character to be matched\nliterally.  If you want a hyphen in your set of characters to be matched and its position  in\nthe  class  is  such that it could be considered part of a range, you must escape that hyphen\nwith a backslash.\n\nExamples:\n\n[a-z]       #  Matches a character that is a lower case ASCII letter.\n[a-fz]      #  Matches any letter between 'a' and 'f' (inclusive) or\n#  the letter 'z'.\n[-z]        #  Matches either a hyphen ('-') or the letter 'z'.\n[a-f-m]     #  Matches any letter between 'a' and 'f' (inclusive), the\n#  hyphen ('-'), or the letter 'm'.\n['-?]       #  Matches any of the characters  '()*+,-./0123456789:;<=>?\n#  (But not on an EBCDIC platform).\n[\\N{APOSTROPHE}-\\N{QUESTION MARK}]\n#  Matches any of the characters  '()*+,-./0123456789:;<=>?\n#  even on an EBCDIC platform.\n[\\N{U+27}-\\N{U+3F}] # Same. (U+27 is \"'\", and U+3F is \"?\")\n\nAs the final two examples above show, you can achieve portability to non-ASCII  platforms  by\nusing the \"\\N{...}\" form for the range endpoints.  These indicate that the specified range is\nto  be  interpreted using Unicode values, so \"[\\N{U+27}-\\N{U+3F}]\" means to match \"\\N{U+27}\",\n\"\\N{U+28}\", \"\\N{U+29}\", ..., \"\\N{U+3D}\", \"\\N{U+3E}\", and \"\\N{U+3F}\", whatever the native code\npoint versions for those are.  These are called \"Unicode\" ranges.  If either end  is  of  the\n\"\\N{...}\"  form,  the  range  is  considered  Unicode.   A  \"regexp\"  warning is raised under\n\"use re 'strict'\" if the other endpoint is specified non-portably:\n\n[\\N{U+00}-\\x09]    # Warning under re 'strict'; \\x09 is non-portable\n[\\N{U+00}-\\t]      # No warning;\n\nBoth of the above match the characters \"\\N{U+00}\" \"\\N{U+01}\",  ...   \"\\N{U+08}\",  \"\\N{U+09}\",\nbut  the  \"\\x09\"  looks  like  it  could  be  a  mistake  so the warning is raised (under \"re\n'strict'\") for it.\n\nPerl also guarantees that the ranges \"A-Z\", \"a-z\", \"0-9\", and any subranges  of  these  match\nwhat  an  English-only  speaker would expect them to match on any platform.  That is, \"[A-Z]\"\nmatches the 26 ASCII uppercase letters; \"[a-z]\" matches the 26 lowercase letters; and \"[0-9]\"\nmatches the 10 digits.  Subranges, like \"[h-k]\", match correspondingly, in this case just the\nfour letters \"h\", \"i\", \"j\", and \"k\".  This is the natural behavior on ASCII  platforms  where\nthe  code  points (ordinal values) for \"h\" through \"k\" are consecutive integers (0x68 through\n0x6B).  But special handling to achieve this may be needed  on  platforms  with  a  non-ASCII\nnative  character set.  For example, on EBCDIC platforms, the code point for \"h\" is 0x88, \"i\"\nis 0x89, \"j\" is 0x91, and \"k\" is 0x92.   Perl specially treats \"[h-k]\" to exclude  the  seven\ncode  points  in  the gap: 0x8A through 0x90.  This special handling is only invoked when the\nrange is a subrange of one of the ASCII uppercase, lowercase, and digit ranges, AND each  end\nof  the range is expressed either as a literal, like \"A\", or as a named character (\"\\N{...}\",\nincluding the \"\\N{U+...\" form).\n\nEBCDIC Examples:\n\n[i-j]               #  Matches either \"i\" or \"j\"\n[i-\\N{LATIN SMALL LETTER J}]  # Same\n[i-\\N{U+6A}]        #  Same\n[\\N{U+69}-\\N{U+6A}] #  Same\n[\\x{89}-\\x{91}]     #  Matches 0x89 (\"i\"), 0x8A .. 0x90, 0x91 (\"j\")\n[i-\\x{91}]          #  Same\n[\\x{89}-j]          #  Same\n[i-J]               #  Matches, 0x89 (\"i\") .. 0xC1 (\"J\"); special\n#  handling doesn't apply because range is mixed\n#  case\n\nNegation\n\nIt is also possible to instead list the characters you do not want to match. You can do so by\nusing a caret (\"^\") as the first character in the character  class.  For  instance,  \"[^a-z]\"\nmatches  any  character  that  is not a lowercase ASCII letter, which therefore includes more\nthan a million Unicode code points.  The class is said to be \"negated\" or \"inverted\".\n\nThis syntax make the caret a special character inside a bracketed character class,  but  only\nif  it is the first character of the class. So if you want the caret as one of the characters\nto match, either escape the caret or else don't list it first.\n\nIn inverted bracketed character classes, Perl ignores the Unicode  rules  that  normally  say\nthat  named  sequence,  and certain characters should match a sequence of multiple characters\nuse under caseless \"/i\" matching.  Following those  rules  could  lead  to  highly  confusing\nsituations:\n\n\"ss\" =~ /^[^\\xDF]+$/ui;   # Matches!\n\nThis  should  match  any  sequences  of characters that aren't \"\\xDF\" nor what \"\\xDF\" matches\nunder \"/i\".  \"s\" isn't \"\\xDF\", but Unicode says that \"ss\" is what \"\\xDF\" matches under  \"/i\".\nSo  which  one \"wins\"? Do you fail the match because the string has \"ss\" or accept it because\nit has an \"s\" followed by another \"s\"?  Perl has chosen the latter.  (See note in  \"Bracketed\nCharacter Classes\" above.)\n\nExamples:\n\n\"e\"  =~  /[^aeiou]/   #  No match, the 'e' is listed.\n\"x\"  =~  /[^aeiou]/   #  Match, as 'x' isn't a lowercase vowel.\n\"^\"  =~  /[^^]/       #  No match, matches anything that isn't a caret.\n\"^\"  =~  /[x^]/       #  Match, caret is not special here.\n\nBackslash Sequences\n\nYou  can  put  any  backslash  sequence character class (with the exception of \"\\N\" and \"\\R\")\ninside a bracketed character class, and it will act just as if you  had  put  all  characters\nmatched by the backslash sequence inside the character class. For instance, \"[a-f\\d]\" matches\nany decimal digit, or any of the lowercase letters between 'a' and 'f' inclusive.\n\n\"\\N\"  within a bracketed character class must be of the forms \"\\N{name}\" or \"\\N{U+hex char}\",\nand NOT be the form that matches non-newlines, for the same reason that a dot  \".\"  inside  a\nbracketed  character  class  loses  its  special  meaning:  it matches nearly anything, which\ngenerally isn't what you want to happen.\n\nExamples:\n\n/[\\p{Thai}\\d]/     # Matches a character that is either a Thai\n# character, or a digit.\n/[^\\p{Arabic}()]/  # Matches a character that is neither an Arabic\n# character, nor a parenthesis.\n\nBackslash sequence character classes cannot form one of the endpoints of a range.  Thus,  you\ncan't say:\n\n/[\\p{Thai}-\\d]/     # Wrong!\n\nPOSIX Character Classes\n\nPOSIX  character classes have the form \"[:class:]\", where class is the name, and the \"[:\" and\n\":]\" delimiters. POSIX character classes only appear inside bracketed character classes,  and\nare a convenient and descriptive way of listing a group of characters.\n\nBe careful about the syntax,\n\n# Correct:\n$string =~ /[[:alpha:]]/\n\n# Incorrect (will warn):\n$string =~ /[:alpha:]/\n\nThe  latter  pattern  would  be a character class consisting of a colon, and the letters \"a\",\n\"l\", \"p\" and \"h\".\n\nPOSIX character classes can be part of a larger bracketed character class.  For example,\n\n[01[:alpha:]%]\n\nis valid and matches '0', '1', any alphabetic character, and the percent sign.\n\nPerl recognizes the following POSIX character classes:\n\nalpha  Any alphabetical character (e.g., [A-Za-z]).\nalnum  Any alphanumeric character (e.g., [A-Za-z0-9]).\nascii  Any character in the ASCII character set.\nblank  A GNU extension, equal to a space or a horizontal tab (\"\\t\").\ncntrl  Any control character.  See Note [2] below.\ndigit  Any decimal digit (e.g., [0-9]), equivalent to \"\\d\".\ngraph  Any printable character, excluding a space.  See Note [3] below.\nlower  Any lowercase character (e.g., [a-z]).\nprint  Any printable character, including a space.  See Note [4] below.\npunct  Any graphical character excluding \"word\" characters.  Note [5].\nspace  Any whitespace character. \"\\s\" including the vertical tab\n(\"\\cK\").\nupper  Any uppercase character (e.g., [A-Z]).\nword   A Perl extension (e.g., [A-Za-z0-9]), equivalent to \"\\w\".\nxdigit Any hexadecimal digit (e.g., [0-9a-fA-F]).  Note [7].\n\nLike the Unicode properties, most of the  POSIX  properties  match  the  same  regardless  of\nwhether  case-insensitive  (\"/i\")  matching  is  in  effect  or  not.  The two exceptions are\n\"[:upper:]\" and \"[:lower:]\".  Under \"/i\", they  each  match  the  union  of  \"[:upper:]\"  and\n\"[:lower:]\".\n\nMost  POSIX  character  classes have two Unicode-style \"\\p\" property counterparts.  (They are\nnot  official  Unicode  properties,  but  Perl  extensions  derived  from  official   Unicode\nproperties.)   The  table  below shows the relation between POSIX character classes and these\ncounterparts.\n\nOne counterpart, in the column labelled \"ASCII-range Unicode\"  in  the  table,  matches  only\ncharacters in the ASCII character set.\n\nThe  other  counterpart, in the column labelled \"Full-range Unicode\", matches any appropriate\ncharacters in the full Unicode character set.  For example, \"\\p{Alpha}\" matches not just  the\nASCII alphabetic characters, but any character in the entire Unicode character set considered\nalphabetic.  An entry in the column labelled \"backslash sequence\" is a (short) equivalent.\n\n[[:...:]]      ASCII-range          Full-range  backslash  Note\nUnicode              Unicode     sequence\n-----------------------------------------------------\nalpha      \\p{PosixAlpha}       \\p{XPosixAlpha}\nalnum      \\p{PosixAlnum}       \\p{XPosixAlnum}\nascii      \\p{ASCII}\nblank      \\p{PosixBlank}       \\p{XPosixBlank}  \\h      [1]\nor \\p{HorizSpace}        [1]\ncntrl      \\p{PosixCntrl}       \\p{XPosixCntrl}          [2]\ndigit      \\p{PosixDigit}       \\p{XPosixDigit}  \\d\ngraph      \\p{PosixGraph}       \\p{XPosixGraph}          [3]\nlower      \\p{PosixLower}       \\p{XPosixLower}\nprint      \\p{PosixPrint}       \\p{XPosixPrint}          [4]\npunct      \\p{PosixPunct}       \\p{XPosixPunct}          [5]\n\\p{PerlSpace}        \\p{XPerlSpace}   \\s      [6]\nspace      \\p{PosixSpace}       \\p{XPosixSpace}          [6]\nupper      \\p{PosixUpper}       \\p{XPosixUpper}\nword       \\p{PosixWord}        \\p{XPosixWord}   \\w\nxdigit     \\p{PosixXDigit}      \\p{XPosixXDigit}         [7]\n\n[1] \"\\p{Blank}\" and \"\\p{HorizSpace}\" are synonyms.\n\n[2] Control characters don't produce output as such, but instead usually control the terminal\nsomehow:  for example, newline and backspace are control characters.  On ASCII platforms,\nin the ASCII range, characters whose code points are between 0 and 31 inclusive, plus 127\n(\"DEL\") are control characters; on  EBCDIC  platforms,  their  counterparts  are  control\ncharacters.\n\n[3] Any  character  that  is  graphical,  that  is,  visible.  This  class  consists  of  all\nalphanumeric characters and all punctuation characters.\n\n[4] All printable characters, which is  the  set  of  all  graphical  characters  plus  those\nwhitespace characters which are not also controls.\n\n[5] \"\\p{PosixPunct}\"  and  \"[[:punct:]]\"  in  the  ASCII  range  match all non-controls, non-\nalphanumeric, non-space characters: \"[-!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~]\" (although if a\nlocale is in effect, it could alter the behavior of \"[[:punct:]]\").\n\nThe similarly named property, \"\\p{Punct}\", matches a somewhat different set in the  ASCII\nrange,  namely \"[-!\"#%&'()*,./:;?@[\\\\\\]{}]\".  That is, it is missing the nine characters\n\"[$+<=>^`|~]\".  This is because Unicode splits what POSIX  considers  to  be  punctuation\ninto two categories, Punctuation and Symbols.\n\n\"\\p{XPosixPunct}\"  and  (under  Unicode rules) \"[[:punct:]]\", match what \"\\p{PosixPunct}\"\nmatches in the ASCII range, plus  what  \"\\p{Punct}\"  matches.   This  is  different  than\nstrictly  matching  according  to  \"\\p{Punct}\".  Another way to say it is that if Unicode\nrules are  in  effect,  \"[[:punct:]]\"  matches  all  characters  that  Unicode  considers\npunctuation, plus all ASCII-range characters that Unicode considers symbols.\n\n[6] \"\\p{XPerlSpace}\"  and \"\\p{Space}\" match identically starting with Perl v5.18.  In earlier\nversions, these differ only in that in  non-locale  matching,  \"\\p{XPerlSpace}\"  did  not\nmatch the vertical tab, \"\\cK\".  Same for the two ASCII-only range forms.\n\n[7] Unlike  \"[[:digit:]]\"  which  matches  digits  in  many writing systems, such as Thai and\nDevanagari, there are currently only two sets of hexadecimal digits, and it  is  unlikely\nthat  more will be added.  This is because you not only need the ten digits, but also the\nsix \"[A-F]\" (and \"[a-f]\") to correspond.  That means only the Latin  script  is  suitable\nfor  these,  and  Unicode  has  only  two  sets of these, the familiar ASCII set, and the\nfullwidth forms starting at U+FF10 (FULLWIDTH DIGIT ZERO).\n\nThere are various other synonyms that can be used besides the names listed in the table.  For\nexample, \"\\p{XPosixAlpha}\" can be written as \"\\p{Alpha}\".   All  are  listed  in  \"Properties\naccessible through \\p{} and \\P{}\" in perluniprops.\n\nBoth  the  \"\\p\"  counterparts always assume Unicode rules are in effect.  On ASCII platforms,\nthis means they assume that the code points from 128 to 255 are Latin-1, and that means  that\nusing  them  under  locale  rules  is unwise unless the locale is guaranteed to be Latin-1 or\nUTF-8.  In contrast, the POSIX character classes are useful under  locale  rules.   They  are\naffected by the actual rules in effect, as follows:\n\nIf the \"/a\" modifier, is in effect ...\nEach of the POSIX classes matches exactly the same as their ASCII-range counterparts.\n\notherwise ...\nFor code points above 255 ...\nThe POSIX class matches the same as its Full-range counterpart.\n\nFor code points below 256 ...\nif locale rules are in effect ...\nThe POSIX class matches according to the locale, except:\n\n\"word\"\nalso  includes the platform's native underscore character, no matter what the\nlocale is.\n\n\"ascii\"\non platforms that don't have the POSIX \"ascii\" extension, this  matches  just\nthe platform's native ASCII-range characters.\n\n\"blank\"\non  platforms  that don't have the POSIX \"blank\" extension, this matches just\nthe platform's native tab and space characters.\n\nif, instead, Unicode rules are in effect ...\nThe POSIX class matches the same as the Full-range counterpart.\n\notherwise ...\nThe POSIX class matches the same as the ASCII range counterpart.\n\nWhich rules apply are determined as described in \"Which character set modifier is in effect?\"\nin perlre.\n\nNegation of POSIX character classes\n\nA Perl extension to the POSIX character class is the ability to negate it. This  is  done  by\nprefixing the class name with a caret (\"^\").  Some examples:\n\nPOSIX         ASCII-range     Full-range  backslash\nUnicode         Unicode    sequence\n-----------------------------------------------------\n[[:^digit:]]   \\P{PosixDigit}  \\P{XPosixDigit}   \\D\n[[:^space:]]   \\P{PosixSpace}  \\P{XPosixSpace}\n\\P{PerlSpace}   \\P{XPerlSpace}    \\S\n[[:^word:]]    \\P{PerlWord}    \\P{XPosixWord}    \\W\n\nThe  backslash  sequence  can  mean either ASCII- or Full-range Unicode, depending on various\nfactors as described in \"Which character set modifier is in effect?\" in perlre.\n\n[= =] and [. .]\n\nPerl recognizes the POSIX character classes \"[=class=]\" and \"[.class.]\", but does not  (yet?)\nsupport them.  Any attempt to use either construct raises an exception.\n\nExamples\n\n/[[:digit:]]/            # Matches a character that is a digit.\n/[01[:lower:]]/          # Matches a character that is either a\n# lowercase letter, or '0' or '1'.\n/[[:digit:][:^xdigit:]]/ # Matches a character that can be anything\n# except the letters 'a' to 'f' and 'A' to\n# 'F'.  This is because the main character\n# class is composed of two POSIX character\n# classes that are ORed together, one that\n# matches any digit, and the other that\n# matches anything that isn't a hex digit.\n# The OR adds the digits, leaving only the\n# letters 'a' to 'f' and 'A' to 'F' excluded.\n\nExtended Bracketed Character Classes\n\nThis  is a fancy bracketed character class that can be used for more readable and less error-\nprone classes, and to perform set operations, such as intersection. An example is\n\n/(?[ \\p{Thai} & \\p{Digit} ])/\n\nThis will match all the digit characters that are in the Thai script.\n\nThis feature became available in Perl 5.18, as experimental; accepted in 5.36.\n\nThe rules used by \"use re 'strict\" apply to this construct.\n\nWe can extend the example above:\n\n/(?[ ( \\p{Thai} + \\p{Lao} ) & \\p{Digit} ])/\n\nThis matches digits that are in either the Thai or Laotian scripts.\n\nNotice the white space in these examples.  This  construct  always  has  the  \"/xx\"  modifier\nturned on within it.\n\nThe available binary operators are:\n\n&    intersection\n+    union\n|    another name for '+', hence means union\n-    subtraction (the result matches the set consisting of those\ncode points matched by the first operand, excluding any that\nare also matched by the second operand)\n^    symmetric difference (the union minus the intersection).  This\nis like an exclusive or, in that the result is the set of code\npoints that are matched by either, but not both, of the\noperands.\n\nThere is one unary operator:\n\n!    complement\n\nAll  the binary operators left associate; \"&\" is higher precedence than the others, which all\nhave equal precedence.  The unary operator right  associates,  and  has  highest  precedence.\nThus this follows the normal Perl precedence rules for logical operators.  Use parentheses to\noverride the default precedence and associativity.\n\nThe main restriction is that everything is a metacharacter.  Thus, you cannot refer to single\ncharacters by doing something like this:\n\n/(?[ a + b ])/ # Syntax error!\n\nThe easiest way to specify an individual typable character is to enclose it in brackets:\n\n/(?[ [a] + [b] ])/\n\n(This is the same thing as \"[ab]\".)  You could also have said the equivalent:\n\n/(?[[ a b ]])/\n\n(You can, of course, specify single characters by using, \"\\x{...}\", \"\\N{...}\", etc.)\n\nThis  last example shows the use of this construct to specify an ordinary bracketed character\nclass without additional set operations.  Note the white space within it.   This  is  allowed\nbecause \"/xx\" is automatically turned on within this construct.\n\nAll  the  other  escapes  accepted by normal bracketed character classes are accepted here as\nwell.\n\nBecause this construct compiles under \"use re 'strict\",  unrecognized escapes  that  generate\nwarnings  in  normal  classes are fatal errors here, as well as all other warnings from these\nclass elements, as well as some practices that don't currently warn  outside  \"re  'strict'\".\nFor example you cannot say\n\n/(?[ [ \\xF ] ])/     # Syntax error!\n\nYou  have  to  have  two  hex digits after a braceless \"\\x\" (use a leading zero to make two).\nThese restrictions are to lower the incidence of typos causing the class to  not  match  what\nyou thought it would.\n\nIf  a  regular bracketed character class contains a \"\\p{}\" or \"\\P{}\" and is matched against a\nnon-Unicode code point, a warning may be raised, as the result is  not  Unicode-defined.   No\nsuch warning will come when using this extended form.\n\nThe final difference between regular bracketed character classes and these, is that it is not\npossible to get these to match a multi-character fold.  Thus,\n\n/(?[ [\\xDF] ])/iu\n\ndoes not match the string \"ss\".\n\nYou  don't  have  to  enclose  POSIX  class  names  inside double brackets, hence both of the\nfollowing work:\n\n/(?[ [:word:] - [:lower:] ])/\n/(?[ [[:word:]] - [[:lower:]] ])/\n\nAny contained POSIX character classes, including things like \"\\w\" and \"\\D\" respect  the  \"/a\"\n(and \"/aa\") modifiers.\n\nNote  that  \"(?[  ])\"  is a regex-compile-time construct.  Any attempt to use something which\nisn't knowable at the time the containing regular expression is compiled is  a  fatal  error.\nIn practice, this means just three limitations:\n\n1.  When  compiled  within  the  scope  of  \"use  locale\"  (or the \"/l\" regex modifier), this\nconstruct assumes that the execution-time locale will be a UTF-8 one, and  the  generated\npattern  always uses Unicode rules.  What gets matched or not thus isn't dependent on the\nactual runtime locale, so tainting is not enabled.  But a \"locale\"  category  warning  is\nraised if the runtime locale turns out to not be UTF-8.\n\n2.  Any user-defined property used must be already defined by the time the regular expression\nis compiled (but note that this construct can be used instead of such properties).\n\n3.  A  regular  expression that otherwise would compile using \"/d\" rules, and which uses this\nconstruct will instead use \"/u\".  Thus this construct tells Perl that you don't want \"/d\"\nrules for the entire regular expression containing it.\n\nNote that skipping white space applies only to the interior of this  construct.   There  must\nnot be any space between any of the characters that form the initial \"(?[\".  Nor may there be\nspace between the closing \"])\" characters.\n\nJust  as  in all regular expressions, the pattern can be built up by including variables that\nare interpolated at regex compilation time.  But currently each such sub-component should  be\nan already-compiled extended bracketed character class.\n\nmy $thaiorlao = qr/(?[ \\p{Thai} + \\p{Lao} ])/;\n...\nqr/(?[ \\p{Digit} & $thaiorlao ])/;\n\nIf  you  interpolate something else, the pattern may still compile (or it may die), but if it\ncompiles, it very well may not behave as you would expect:\n\nmy $thaiorlao = '\\p{Thai} + \\p{Lao}';\nqr/(?[ \\p{Digit} & $thaiorlao ])/;\n\ncompiles to\n\nqr/(?[ \\p{Digit} & \\p{Thai} + \\p{Lao} ])/;\n\nThis does not have the effect that someone reading the source code would  likely  expect,  as\nthe intersection applies just to \"\\p{Thai}\", excluding the Laotian.\n\nDue  to  the  way  that  Perl  parses  things,  your  parentheses and brackets may need to be\nbalanced, even including comments.  If you run into  any  examples,  please  submit  them  to\n<https://github.com/Perl/perl5/issues>,  so  that we can have a concrete example for this man\npage.\n\nperl v5.38.2                                 2026-08-18                           PERLRECHARCLASS(1)"
                    }
                ]
            }
        }
    }
}