Skip to content

Instantly share code, notes, and snippets.

@vedal
Last active January 31, 2018 11:31
Show Gist options
  • Save vedal/6f13b3603ad4b3924f74ec01cfe5f7c9 to your computer and use it in GitHub Desktop.
Save vedal/6f13b3603ad4b3924f74ec01cfe5f7c9 to your computer and use it in GitHub Desktop.
[Remove punctuation from string using regex] Use regex to clean string punctuation fast #punctuation #strip #regex
// vim: syntax=python
# remove punctuation
re.sub(r'[^\w\s]','',string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment