Regex to remove punctuation before/after dictionary words
I know. I should just learn it. But every tutorial I look at just makes my head spin.
So here's the thing: I get a bunch of strings that are single words. I don't know what they are, so it has to be dynamic. But I have to strip out the punctuation that they come with, outside of the word boundaries.
(anyway) should become anyway
and/ becomes and
or, becomes or
'cool' becomes cool
but they're remains they're
and co-produce stays co-produce
Seems simple, but google is not my friend, once again.
thanks in advance for any suggestions. And if anybody knows of a non- head spinny regex tutorial, I'd love to see it.