Suppose I have the following input.
Header
thing0 some info
thing4 some info
thing4 some info
thing4 some info
thing2 some info
thing2 some info
thing3 some info
Now I want to add “foo” to the last successful match of “thing4” like this.
Header
thing0 some info
thing4 some info
thing4 some info
thing4 some info
foo
thing2 some info
thing2 some info
thing3 some info
The order is not necessarily guaranteed, but the sequential numbering in this example is just to show that some lines of text have a search keyword in front of them, and that they are usually grouped together in the input, but this is not guaranteed.
Mozzy source
share