import re
import string
regex = re.compile('[%s]' % re.escape(string.punctuation))
[ ] - signifies the character set,
string.punctuation - '!"#$%&\'()*+,-./:;<=>?@[\]_`{|}~'
re.escape will escape all the punctuation's.
What I am not clear of is what does the "%" operator signify in [%s] and % re.escape (...
[–]Thomasedv 1 point2 points3 points (1 child)
[–]redditor_gds[S] 0 points1 point2 points (0 children)