How does the ? make a quantifier lazy in regex

后端 未结 4 1528
忘了有多久
忘了有多久 2020-12-06 07:56

I\'ve been looking into regex lately and figured that the ? operator makes the *,+, or ? lazy. My question is how does it

4条回答
  •  北海茫月
    2020-12-06 08:38

    This very much depends on the implementation, I guess. But since every quantifier I am aware of can be modified with ? it might be reasonable to implement it that way.

提交回复
热议问题