Ah! I see what your getting at. You want this (single) output with multiple highlights:
this finds <and> matches <and> highlights matches.
So if two matches occur with say 2 x number of context words of each other, amalgamate the adjacent matches + contexts into a single output.
Hmmm. I'll have to thunk on that.
In reply to Re^5: Regex: Matching around a word(s)
by BrowserUk
in thread Regex: Matching around a word(s)
by shotgunefx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |