in reply to A Search And Replace Question
You may be interested in reading up on perlre for Perl regular expressions, and seeing how many examples you can figure out. Use perlre as a reference.
Update: Based on a brief Chatterbox discussion, it was determined that this isn't entirely what you want. I guess I misunderstood. If you want to put $extra_stuff at the end of the string, it might be most efficient to do something like this:
If $_ contains multiple lines, perhaps this might work better:$_ .= $extra_stuff if /search term/;
(That last bit is untested and sorta makes sense in my head, but your mileage may vary.)s/\G.*?$search_term.*$/$&$extra_stuff/gm;
|
|---|