Search between 2 words
Please forgive me for asking this question.
I know the answer requires the use of regex
But can anybody explain it to me in simple words: I need to get word(s) between two other words from a text. How do I do it?
Non regex answers also would be helpful.
My knowledge about regex is very little. Thank you.
Posted Aug 27, 2020, 3:07 AM UTC
Let's say you have a variable, %text, as below:
I know the answer requires the use of regex
And you want to extract everything between "know" and "use":
Variable Search Replace action
Variable: %text
Search: know.*?use
Store Matches in Array: %match
After running the above, %match1 will contain:
know the answer requires the use
I'll check this and come back Thank you
Oh Yes!
This works
Now what if I want only the "central part". Not "know" and "use"
Thanks in advance
For now, I used a second and third variable search and replace functions to replace the initial and final parts with "null".
Works!!!
Thank you But if, there is a direct way to do it, I would be happy.
Search: (?<=know).*?(?=use)
Thank you