$str =~ m/$regex(?{push @substrings, [$^N,$pos,length $^N]}) (?!) /x;