http://www.perlmonks.org?node_id=631326


in reply to One Zero variants_without_repetition

some fun, at least for me!
$_ = "00111"; do { print "$_\n"; } while ( s/(1*?)(0*?)01/$2${1}10/ ); 00111 01011 10011 01101 10101 11001 01110 10110 11010 11100
Oha

edit: feel free to change $2${1}10 with $2$1\Q10 :-)