我想从他们身上去掉标点符号。我怎样才能用regex循环和剥离。>>> a="what is. your. name?"我对python和正则表达式很陌生。当我不删除句子中的标点符号时,它会返回这种类型的错误。File "/usr/lib/python2.7/re.py", line 137, in match
return _compi
我希望Python只删除字符串中的一些标点符号,假设我想删除除“@”之外的所有标点符号。brown fox like totally jumped manThe quick brown fox like totally jumped @man
有没有一种方法可以选择性地从文本中删除标点符号,而忽略我们希望在文本中保持不变的标点符号?
我对python (和这个社区)来说相当陌生,这是一个从很久以前来自的问题中分叉出来的问题['hello', '...', 'h3.a', 'ds4,']x = [''.join(c for c in s if c not in string.punctuation) for s in x]print(