in reply to Matching across newlines without stripping them out

The simple answer to is there a way to tell the RE engine to ignore newline characters is No.

However, I think that you are dismissing the idea of generating the regex too quickly. It is a quite legitimate thing to do. In this case I would use \s* instead of \n* if the is any chance of other whitespace that you want to ignore.

#! perl -slw use strict; my $search_string = 'uekasdh'; # Split the search string into chars and intersperse # them with the "ignore whitespace" regex. my $re = join '\s*', split '', $search_string; my $data = do{ local $/; <DATA> }; # Slurp the data $data =~ s[$re][jjjjjjjj]; # Find and replace. print $data;

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller