what's an idiomatic way to match certain regions of a string (m//mg), and then for each sub-region, perform substitutions (s///mg)? I can think of several options, none of which seems appealing.
E.g. within regions delimited by "# START" / "# END", uncomment lines (s/^[ #]*//g). I could turn the string into a line-list, use the flip-flop to identify regions, and s///g for each line. But isn't there something cleaner and more general?
In reply to s///g within m//g regions by almr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |