This may be a quirk of your library (or use) with regex greed. (00)gets 00 (1*(01)*1*)*sucks up 1011, and then the remaining one (10)does not match the last. Then, for some reason, your library does not decide to step back and try another match (thanks @Paul Rubel, @marcog).
source
share