johk95
johk95

Reputation: 953

RegEx lazy quantifier at beginning

Why doesn't this

re.search(r"\w??at", "cat")

match only "at"? Given the ? quantifier is set to lazy?

Actual result:

<re.Match object; span=(0, 3), match='cat'>

Expected result:

<re.Match object; span=(1, 3), match='at'>

Upvotes: 0

Views: 20

Answers (0)

Related Questions