If the text for the experiment is "aaa" and the regexp pattern "(a)+" - why do I get only one match: "aaa"?
Why don't I get:
- "a", "aa","aaa" (all starting from position 0)
- "a"(starting from position 1)
- "aa" (starting from position 1)
- "a" (starting from position 2)?
Should I keep on mind some imaginary cursor that having found one match - moves to the end of it, and the new search goes on from that new position?
It has nothing to do with the so called lazy quantificators, if I'm not mistaken.
If I use "(a)+?" instead of the first pattern, I get 3 matches, which is actually what you expect. But it has nothing to do with what I described before.
Is it possible to get all the straight forward occurrences?