Your comments

Also after operations like wrap with tag. This would make writing really useful macros possible. For example, first replace this with that, then replace foo with bar, then wrap everything in a <table> tag.