This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5db: remove leading ampersand.
[perl5.git] / ext / re / t / regop.pl
1 use re Debug=>qw(DUMP EXECUTE OFFSETS TRIEC);
2 my @tests=(
3   XY     =>  'X(A|[B]Q||C|D)Y' ,
4   foobar =>  '[f][o][o][b][a][r]',
5   x  =>  '.[XY].',
6   'ABCD' => '(?:ABCP|ABCG|ABCE|ABCB|ABCA|ABCD)',
7   'D:\\dev/perl/ver/28321_/perl.exe'=>
8   '/(\\.COM|\\.EXE|\\.BAT|\\.CMD|\\.VBS|\\.VBE|\\.JS|\\.JSE|\\.WSF|\\.WSH|\\.pyo|\\.pyc|\\.pyw|\\.py)$/i',
9   'q'=>'[q]',
10 );
11 while (@tests) {
12     my ($str,$pat)=splice @tests,0,2;
13     warn "\n";
14     $pat="/$pat/" if substr($pat,0,1) ne '/';
15     # string eval to get the free regex message in the right place.
16     eval qq[
17         warn "$str"=~$pat ? "%MATCHED%" : "%FAILED%","\n";
18     ];
19     die $@ if $@;
20 }