I have a string where im trying to extract a specic section of words and was hoping if someone could help me with a safe way of parsing the string to get just this sections. The string is formated as such…
_____ _____ replied to _____ _____ about the **THIS IS THE PART I NEED TO GET** topic in the _____ forum.
Wherever there is a blank than it is possible that any word could be there, also the part that i need to get could be of any length.
Here is a regex that matches what you posted and extracts the content that you put in the
**in a group.You can test it here.
The non-greedy version looks like
You can test it here.
These are the RAW regular expressions, for Java you need to escape the
\with\\.unlike most regex questions here this one is actually a good fit for a regular expression