Commit | Line | Data |
1e2e3d02 |
1 | use re Debug=>qw(DUMP EXECUTE OFFSETS TRIEC); |
3dab1dad |
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)', |
07be1b83 |
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]', |
3dab1dad |
10 | ); |
11 | while (@tests) { |
12 | my ($str,$pat)=splice @tests,0,2; |
13 | warn "\n"; |
07be1b83 |
14 | $pat="/$pat/" if substr($pat,0,1) ne '/'; |
3dab1dad |
15 | # string eval to get the free regex message in the right place. |
16 | eval qq[ |
07be1b83 |
17 | warn "$str"=~$pat ? "%MATCHED%" : "%FAILED%","\n"; |
3dab1dad |
18 | ]; |
19 | die $@ if $@; |
20 | } |