Hi I am trying to create a regex that will do the following
grab 5 words before the search phrase (or x if there is only x words there) and 5 words after the search
You can do the folowing (it is a bit computation heavy, so it woudn't be efficient for very long strings):
Codepad example here