3 ms·
Is there a difference between greedy and non-greedy atoms?
by rhizome 10y ago
Is there a difference between greedy and non-greedy atoms?
- ghusbands 10y agoIn the order of searching and hence the match you can get, yes. In performance in the case of a non-match, no.
- cyphar 10y agoThe regex a?a?a?a?a?aaaaa against the string aaaaa will complete in linear time if you use non-greedy ?s but with greedy matching it has exponential complexity. So, there is a difference.