in reply to Match and Extract String with Regex

If it's only that simple kind of problem that you mentioned (find one string in another string), then Ikegami's solution (index) should suffice. If you need to do that by regex, try:

... my $str1 = 'AT1G7. +126[0]*'; my $str2 = 'AT1G7. +126[0]*_|_chr1'; ... (my $results) = $str2 =~ /\Q$str1/g; print $results if $results; ...

Regards

mwa