This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate with Sarathy.
[perl5.git] / t / pragma / warn / regcomp
CommitLineData
599cee73
PM
1 regcomp.c AOK
2
767a6a26
PM
3 Strange *+?{} on zero-length expression [S_study_chunk]
4 /(?=a)?/
599cee73 5
767a6a26 6 %.*s matches null string many times [S_regpiece]
599cee73
PM
7 $a = "ABC123" ; $a =~ /(?=a)*/'
8
767a6a26
PM
9 /%.127s/: Unrecognized escape \\%c passed through" [S_regatom]
10 /\m/
599cee73 11
767a6a26
PM
12 Character class syntax [. .] is reserved for future extensions [S_regpposixcc]
13
14 Character class syntax [= =] is reserved for future extensions [S_checkposixcc]
15
16 Character class syntax [%c %c] belongs inside character classes [S_checkposixcc]
17
599cee73 18
767a6a26 19
599cee73
PM
20
21__END__
767a6a26 22# regcomp.c [S_regpiece]
4438c4b7 23use warnings 'unsafe' ;
599cee73
PM
24my $a = "ABC123" ;
25$a =~ /(?=a)*/ ;
4438c4b7 26no warnings 'unsafe' ;
0453d815 27$a =~ /(?=a)*/ ;
599cee73
PM
28EXPECT
29(?=a)* matches null string many times at - line 4.
30########
767a6a26 31# regcomp.c [S_study_chunk]
4438c4b7 32use warnings 'unsafe' ;
599cee73
PM
33$_ = "" ;
34/(?=a)?/;
4438c4b7 35no warnings 'unsafe' ;
0453d815 36/(?=a)?/;
599cee73
PM
37EXPECT
38Strange *+?{} on zero-length expression at - line 4.
39########
767a6a26
PM
40# regcomp.c [S_regatom]
41use warnings 'unsafe' ;
42$a =~ /\m/ ;
43no warnings 'unsafe' ;
44EXPECT
45Unrecognized escape \m passed through at - line 3.
46########
47# regcomp.c [S_regpposixcc S_checkposixcc]
4438c4b7 48use warnings 'unsafe' ;
599cee73 49$_ = "" ;
e8c223df 50/[:alpha:]/;
b8c5462f
JH
51/[.bar.]/;
52/[=zog=]/;
e8c223df
JH
53/[[:alpha:]]/;
54/[[.foo.]]/;
55/[[=bar=]]/;
56/[:zog:]/;
4438c4b7 57no warnings 'unsafe' ;
e8c223df
JH
58/[:alpha:]/;
59/[.foo.]/;
60/[=bar=]/;
61/[[:alpha:]]/;
62/[[.foo.]]/;
63/[[=bar=]]/;
64/[:zog:]/;
65/[[:zog:]]/;
599cee73 66EXPECT
b8c5462f
JH
67Character class syntax [: :] belongs inside character classes at - line 4.
68Character class syntax [. .] belongs inside character classes at - line 5.
69Character class syntax [. .] is reserved for future extensions at - line 5.
70Character class syntax [= =] belongs inside character classes at - line 6.
71Character class syntax [= =] is reserved for future extensions at - line 6.
e8c223df
JH
72Character class syntax [. .] is reserved for future extensions at - line 8.
73Character class syntax [= =] is reserved for future extensions at - line 9.
74Character class syntax [: :] belongs inside character classes at - line 10.
75Character class [:zog:] unknown at - line 19.