I am currently reading The Regular Expression Cookbook by Jan Goewaerts and Stephen Levitan. They mention that any quantifier can be made lazy by placing ?after it, so this includes a quantifier ?, resulting in ??. Unfortunately, the book is no longer mentioned ??.
As I understand it, it x?will match the x character zero or once, but preferably once. x??coincides with x equal to zero or the same, but will preferably correspond to zero time at which this is possible.
I played a little at regex101.com , but did not come up with a situation where this difference really mattered. Does it ??have any practical significance in any flavor of regular expression?
source
share