in reply to Matching across newlines without stripping them out

That's the only way I can think of ... but you can make it a bit easier on yourself.

my $goal = "uekasdh"; my $search = join "\\n*", split "", $goal; my $replace = "JJJJJ"; $line =~ s/$search/$replace/o;

--
TTTATCGGTCGTTATATAGATGTTTGCA