import re

# unicode 编码匹配范围[u4e00-u9fa5]
pattern = re.compile('(\w+) (\w+)')

s = 'hello 123,hello 456'

s_list = pattern.findall(s)
print(s_list)

s_list = pattern.sub('hello world',s)
print(s_list)

 

相关文章:

  • 2021-08-11
  • 2022-12-23
  • 2021-07-10
  • 2021-07-14
  • 2021-09-30
  • 2021-05-21
  • 2022-03-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
相关资源
相似解决方案