Is there any way using regular expression to capture this group. result should be 2

后端 未结 0 1039
盖世英雄少女心
盖世英雄少女心 2020-12-07 14:29

import re

pattern = r\'faf\'

string = \'fafaf\'

print(len(re.findall(pattern, string)))

it is giving the answer as 1, but required answer is 2

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