if ( "aab" =~ /(.)(*MARK:go)\1(*SKIP:go)(*FAIL)|.*/ ) { say $&; # ab }