I need a RegEx expression that leaves out a word if it is present at the end of the string, e.g. if the string ends with Ave. it should not be included where as if it starts with Ave. it should:
Drive Ave. should return Drive Ave. Drive should return Ave. Drive Ave. Drive Ave. should return Ave. Drive
I seem to struggle with the RegEx for it to handle the examples in one go.
“Drive” is not static in the string. “Ave.” should always be left out if it exists last in the string. But if the string starts with “Ave.” it should be included.