I'm quite new to regular expression, and have been searching around for away to do this without success. Given a string, I want to remove any pattern that starts with "abc", ends with "abc", and does not contain "abc" in the middle. If I do
'abc.*(abc).*abc'
it will match any patter starts with "abc", ends with "abc", and does contain "abc" in the middle. How do I do the opposite. I try
'abc.*^(abc).*abc'
but it won't work.