I<inside> character classes, the [] are part of the construct, for
example: /[012[:alpha:]345]/. Note that [= =] and [. .] are not
currently implemented; they are simply placeholders for future
-extensions.
+extensions and will cause fatal errors.
=item Character class syntax [. .] is reserved for future extensions
-(W regexp) Within regular expression character classes ([]) the syntax
+(F regexp) Within regular expression character classes ([]) the syntax
beginning with "[." and ending with ".]" is reserved for future
-extensions. If you need to represent those character sequences inside a
-regular expression character class, just quote the square brackets with
-the backslash: "\[." and ".\]".
+extensions. If you need to represent those character sequences inside
+a regular expression character class, just quote the square brackets
+with the backslash: "\[." and ".\]".
=item Character class syntax [= =] is reserved for future extensions
-(W regexp) Within regular expression character classes ([]) the syntax
+(F) Within regular expression character classes ([]) the syntax
beginning with "[=" and ending with "=]" is reserved for future
-extensions. If you need to represent those character sequences inside a
-regular expression character class, just quote the square brackets with
-the backslash: "\[=" and "=\]".
+extensions. If you need to represent those character sequences inside
+a regular expression character class, just quote the square brackets
+with the backslash: "\[=" and "=\]".
=item Character class [:%s:] unknown
Perl_croak(aTHX_
"Character class [:%.*s:] unknown",
t - s - 1, s + 1);
- } else if (ckWARN(WARN_REGEXP) && !SIZE_ONLY)
+ } else if (!SIZE_ONLY)
/* [[=foo=]] and [[.foo.]] are still future. */
- Perl_warner(aTHX_ WARN_REGEXP,
- "Character class syntax [%c %c] is reserved for future extensions", c, c);
+ Perl_croak(aTHX_
+ "Character class syntax [%c %c] is reserved for future extensions", c, c);
} else {
/* Maternal grandfather:
* "[:" ending in ":" but not in ":]" */
Perl_warner(aTHX_ WARN_REGEXP,
"Character class syntax [%c %c] belongs inside character classes", c, c);
if (c == '=' || c == '.')
- Perl_warner(aTHX_ WARN_REGEXP,
- "Character class syntax [%c %c] is reserved for future extensions", c, c);
+ Perl_croak(aTHX_
+ "Character class syntax [%c %c] is reserved for future extensions", c, c);
}
}
}
Character class [:%.*s:] unknown [S_regpposixcc]
- Character class syntax [. .] is reserved for future extensions [S_regpposixcc]
-
- Character class syntax [= =] is reserved for future extensions [S_checkposixcc]
-
Character class syntax [%c %c] belongs inside character classes [S_checkposixcc]
/%.127s/: false [] range \"%*.*s\" in regexp [S_regclass]
use warnings 'regexp' ;
$_ = "" ;
/[:alpha:]/;
-/[.bar.]/;
-/[=zog=]/;
-/[[:alpha:]]/;
-/[[.foo.]]/;
-/[[=bar=]]/;
/[:zog:]/;
/[[:zog:]]/;
no warnings 'regexp' ;
/[:alpha:]/;
-/[.foo.]/;
-/[=bar=]/;
-/[[:alpha:]]/;
-/[[.foo.]]/;
-/[[=bar=]]/;
-/[[:zog:]]/;
/[:zog:]/;
+/[[:zog:]]/;
EXPECT
Character class syntax [: :] belongs inside character classes at - line 5.
-Character class syntax [. .] belongs inside character classes at - line 6.
-Character class syntax [. .] is reserved for future extensions at - line 6.
-Character class syntax [= =] belongs inside character classes at - line 7.
-Character class syntax [= =] is reserved for future extensions at - line 7.
-Character class syntax [. .] is reserved for future extensions at - line 9.
-Character class syntax [= =] is reserved for future extensions at - line 10.
-Character class syntax [: :] belongs inside character classes at - line 11.
-Character class [:zog:] unknown at - line 12.
+Character class syntax [: :] belongs inside character classes at - line 6.
+Character class [:zog:] unknown at - line 7.
+########
+# regcomp.c [S_checkposixcc]
+BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 }
+use warnings 'regexp' ;
+$_ = "" ;
+/[.zog.]/;
+no warnings 'regexp' ;
+/[.zog.]/;
+EXPECT
+Character class syntax [. .] belongs inside character classes at - line 5.
+Character class syntax [. .] is reserved for future extensions at - line 5.
+########
+# regcomp.c [S_checkposixcc]
+BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 }
+use warnings 'regexp' ;
+$_ = "" ;
+/[[.zog.]]/;
+no warnings 'regexp' ;
+/[[.zog.]]/;
+EXPECT
+Character class syntax [. .] is reserved for future extensions at - line 5.
########
# regcomp.c [S_regclass]
$_ = "";