【问题标题】:python : combine listpython:组合列表
【发布时间】:2022-06-14 12:45:13
【问题描述】:

我使用搜索函数re.finditer() 并将span 设为1 个元组
示例:text = "感谢您的帮助,您的帮助真的很好,帮助很大"
我用过

import re
text = "Thanks for the help, your Help is really good, it's really a big help"
for key in re.finditer('help',text,re.I):
   print(key.group())
   cvt = text.replace('help','job')
   print(cvt)

从第二个帮助变为工作,但它转换了一切。如何让它只切换我想要的单词

【问题讨论】:

  • igkey = key.splitlines()?

标签: python regex


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-05-23
  • 2017-08-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-11
相关资源
最近更新 更多