D:\>perl -E"my $x; BEGIN{$x=qr/a.*u/}; use re 'debug'; my $str = 'aou'; say $str =~ /$x/" 1 D:\>perl -E"my $x; BEGIN{$x=qr/a.*u/}; use re 'debug'; my $str = 'aou'; say $str =~ /$x/g" aou #### D:\>perl -E"my $x; BEGIN{$x=q/a.*u/}; use re 'debug'; my $str = 'aou'; say $str =~ /$x/" Compiling REx "a.*u" Final program: 1: EXACT (3) 3: STAR (5) 4: REG_ANY (0) 5: EXACT (7) 7: END (0) anchored "a" at 0..0 floating "u" at 1..9223372036854775807 (checking floating) minlen 2 Matching REx "a.*u" against "aou" Intuit: trying to determine minimum start position... doing 'check' fbm scan, [1..3] gave 2 Found floating substr "u" at offset 2 (rx_origin now 0)... ... YADDA YADDA ... #### 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)" #### This is perl 5, version 32, subversion 1 (v5.32.1) built for MSWin32-x64-multi-t hread