Understanding regexes: r'(.*)\1' vs r'(.*)' vs r'(.)\1*'

前端 未结 0 438
忘了有多久
忘了有多久 2021-02-10 10:18

In these Python examples, why does:

>>> sub(r\'(.)\\1*\', lambda m: str(m.group()*3)+\'-\', \'abc\')

outputs

\'aaa-bbb-ccc-\'

相关标签:
回答
  • 消灭零回复
提交回复
热议问题