hixiaowei

1.有个坑 re.sub(\'[^\w]\', \' \', \'hello world, get rid of comma\')   --> [^\w] 非字符的意思

[^abc] 匹配除了a,b,c之外的字符

import re
text_string = re.sub(r\'([^\s\w]|_|[0-9])+\',\'\'," I 3   _ I  3 ? _ love you")
print (text_string)
I     I     love you

参考:https://www.cnblogs.com/12260420zxx/p/13663291.html
https://blog.csdn.net/u010211479/article/details/78490854

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-22
  • 2021-12-24
  • 2022-02-09
  • 2021-10-18
  • 2021-12-04
猜你喜欢
  • 2021-12-24
  • 2021-09-06
  • 2021-11-28
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案