3 ms·
no it'll still match but because both are non-greedy it could match on just c1 instead of abc123.
by simcop2387 12y ago
no it'll still match but because both are non-greedy it could match on just c1 instead of abc123.
- prawks 12y agoIt could match on c1, but I believe since most (all?) regex parsers parse left-to-right, it will match the a, look for another a-z character or a digit, find b, repeat, find c, then find 1 which completes the pattern.
- gatehouse 12y agohttp://regex101.com/r/aR5xM2 http://regex101.com/r/aR5xM2 I used this tester posted elsewhere in the thread, it seems like since the lazy components expand "as needed" to achieve a match, it will succeed on "abc1". EDIT: I wrapped it in a group for clarity.