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