I couldn't understand why this regular expression,
re.findall(r"(do|re|mi)+","mimi rere midore"),
generates this result,
['mi', 're', 're'].
My expected result is ['mimi', 'rere', 'midore']...
However, when I use this regular expression,
re.findall(r"(?:do|re|mi)+","mimi rere midore"),
it generates the result as expected.
Can you tell me the different between two regular expressions?
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…