I have the following example
"Foo tells the bar that the bar loves potatoes. The bar tells foo that the bar is not like potatoes."
I want a substring between the potatoes and the previous appearance of the bar. So, in this example, I want the bar to love potatoes, and I also want the bar to not like potatoes as a result. How can I achieve this through one regex? I know that if I applied two separate regular expressions, I could get the results, but I want to know if this is possible with only one regular expression.
Thanks RG
source
share