In the regular expression, it is aaabbcdfsaabbbdfcsdaaddf that matches (a{1,3}b{1,5}) with (a{1,3}b{1,5}), so why is (a{1,3}b{1,5})* the first aaabb?
regex
This is because *
is a quantifier that represents "zero or more".
If you use +
, a quantifier that represents "more than one," aaabb and aabbb will match.
ex) (a{1,3}b{1,5})+
© 2024 OneMinuteCode. All rights reserved.