Skip to content

Instantly share code, notes, and snippets.

@lucasrizoli
Last active December 25, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasrizoli/7013194 to your computer and use it in GitHub Desktop.
Save lucasrizoli/7013194 to your computer and use it in GitHub Desktop.
regex punctuation class
import re
punctexp = re.compile(r"[\!\"\#\$\%\&\\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^_\`\{\|\}\~]")
# Could also…
# import string
# re.compile('[{0}]'.format(re.escape(string.punctuation)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment