I am quite unexperienced in using regex. I have a text like this:
This is a demo text I need a special part The text i want to get is here.<
The result i need is this : "text i want to get" .So i have to search backwards from "get" to "text" i guess.
My regex (?<=text\s).*(?<=\bget)
is returning "I need a special part The text i want to get"
How can I modify this regex to work backwards from "get" to "text"?
Use a negative lookahead to assert that "text" does not appear again after the starting "text" of the match.
Also, if you want to include "text" and "get", you must match them (rather than look around for them).
See demo.