D:\>perl -E"my $x; BEGIN{$x=qr/a.*u/}; use re 'debug'; my $str = 'aou'; say $str =~ /$x$x/" Compiling REx "(?^u:a.*u)(?^u:a.*u)" Final program: 1: EXACT (3) 3: STAR (5) 4: REG_ANY (0) 5: EXACT (9) 9: STAR (11) 10: REG_ANY (0) 11: EXACT (13) 13: END (0) anchored "a" at 0..0 floating "ua" at 1..9223372036854775807 (checking floating) minlen 4 String shorter than min possible regex match (3 < 4) Freeing REx: "(?^u:a.*u)(?^u:a.*u)"