I found this thread: Best way to strip punctuation from a string in Python
But was hoping to come up with a way to do this except not to strip out the periods in links. So if the string is
I love using stackoverflow.com on Fridays, Saturdays and Mondays!
It would return
I love using stackoverflow.com on Fridays Saturdays and Monday
In fact ideally I would be able to pass in a list of common link endings like .com, .net, .ly etc.
You can use negative look-aheads:
[,!?]|\.(?!(com|org|ly))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With