Yes. Turn the regex engine into debug mode and it will print what it does:
use re 'debug';
my $str = "abcdefg";
$str =~ m/[ef]+/;
Which gives the result:
Compiling REx "[ef]+"
Final program:
1: PLUS (13)
2: ANYOF[ef] (0)
13: END (0)
stclass ANYOF[ef] plus minlen 1
Matching REx "[ef]+" against "abcdefg"
Matching stclass ANYOF[ef] against "abcdefg" (7 bytes)
4 <abcd> <efg> | 1:PLUS(13)
ANYOF[ef] can match 2 times out of 2147483647...
6 <abcdef> <g> | 13: END(0)
Match successful!
Freeing REx: "[ef]+"
source
share