We're scrubbing a ridiculous amount of data, and am finding many examples of clean data that are left with irrelevant punctuation at the beginning and end of the final string. Quotes and DoubleQuotes are fine, but leading/trailing dashes, commas, etc need to be removed
I've studied the answer at How can I remove all leading and trailing punctuation?, but am unable to find a way to accomplish the same in PHP.
- some text. dash and period should be removed
"Some Other Text". period should be removed
it's a matter of opinion apostrophe should be kept
/ some more text? Slash should be removed and question mark kept
In short,
- Certain punctuation occurring BEFORE the first AlphaNumeric character must be removed
- Certain punctuation occurring AFTER the last AlphaNumeric character must be removed
How can I accomplish this with PHP - the few examples I've found surpass my RegEx/JS abilites.