I have a long string variable X and another string(a word or two in length) Y. I want to find 50 words before and after Y where it appears in X. How can I achieve this using reg-ex.
I have a long string variable X and another string(a word or two in
Share
This code generates a string of 300 words (Word0 .. Word299), defines the target to search for as
"Word12 Word13"and then finds up to 50 words before that string and up to 50 words after it.