13 if ($x =~ /^abc/) {print "ok 1\n";} else {print "not ok 1\n";}
14 if ($x !~ /^def/) {print "ok 2\n";} else {print "not ok 2\n";}
17 if ($x =~ /^def/) {print "ok 3\n";} else {print "not ok 3\n";}
22 if (/^([0-9][0-9]*)/) {print "ok 4\n";} else {print "not ok 4\n";}
24 if ($x =~ /^xxx/) {print "not ok 5\n";} else {print "ok 5\n";}
25 if ($x !~ /^abc/) {print "not ok 6\n";} else {print "ok 6\n";}
27 if ($x =~ /def/) {print "ok 7\n";} else {print "not ok 7\n";}
28 if ($x !~ /def/) {print "not ok 8\n";} else {print "ok 8\n";}
31 if ($x !~ /.def/) {print "ok 9\n";} else {print "not ok 9\n";}
32 if ($x =~ /.def/) {print "not ok 10\n";} else {print "ok 10\n";}
34 if ($x =~ /\ndef/) {print "ok 11\n";} else {print "not ok 11\n";}
35 if ($x !~ /\ndef/) {print "not ok 12\n";} else {print "ok 12\n";}
39 if (/(a*b*)(c*)/ && $1 eq 'aaabbb' && $2 eq 'ccc') {
44 if (/(a+b+c+)/ && $1 eq 'aaabbbccc') {
50 if (/a+b?c+/) {print "not ok 15\n";} else {print "ok 15\n";}
54 if (/a+b?c+/) {print "ok 16\n";} else {print "not ok 16\n";}
55 if (/a*b+c*/) {print "ok 17\n";} else {print "not ok 17\n";}
59 if (/a*b?c*/) {print "ok 18\n";} else {print "not ok 18\n";}
60 if (/a*b+c*/) {print "not ok 19\n";} else {print "ok 19\n";}
64 if (/bcd|xyz/) {print "ok 20\n";} else {print "not ok 20\n";}
65 if (/xyz|bcd/) {print "ok 21\n";} else {print "not ok 21\n";}
67 if (m|bc/*d|) {print "ok 22\n";} else {print "not ok 22\n";}
69 if (/^$_$/) {print "ok 23\n";} else {print "not ok 23\n";}
71 $* = 1; # test 3 only tested the optimized version--this one is for real
72 if ("ab\ncd\n" =~ /^cd/) {print "ok 24\n";} else {print "not ok 24\n";}
74 # [ID 20010618.006] tests 25..26 may loop
77 my $have_alarm = $Config{d_alarm};
78 local $SIG{ALRM} = sub { die "timeout\n" };
83 ? eval { alarm(2); my $match = /G.F$/; alarm(0); !$match }
88 print "not ok 25\t# " . $@ || "should not match\n";
91 ? eval { alarm(2); my $match = /[F]F$/; alarm(0); !$match }
96 print "not ok 26\t# " . $@ || "should not match\n";