Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: search and replace questionby Hue-Bond (Priest) |
on Mar 11, 2010 at 08:21 UTC ( [id://827977]=note: print w/replies, xml ) | Need Help?? |
I've tried wildcard'ing the search string but cannot get it to work - I always seem to end up greedily taking up a lot of the rest of the file Wildcards are greedy by default, which means that they'll take as much as they can, as you have already seen. Try appending a question mark to the quantifier, to make it non-greedy, ie use abc.*? instead of abc.*. Also - I cannot get my search to find these "search strings" that are split over a line - I guess if I can get the wildcard working I could put a linefeed in there ? Use the /s modifier in the regex. --
In Section
Seekers of Perl Wisdom
|
|