In java regex
I have read about Greedy and Reluctant Quantifiers. They mentioned as
A reluctant or "non-greedy" quantifier first matches as little as possible. So the .* matches nothing at first, leaving the entire string unmatched
In this example
source:
yyxxxyxx
pattern:.*xx
greedy quantifier *
and produces
0 yyxxxyxx
reluctant qualifier *?
, and we get the following:
0 yyxx
4 xyxx
Why result of yxx
, yxx
not possible even it is the smallest possible value?