in reply to A (non) reg-ex question
$str =~ /(0+)(1+)/; $is0n1n = length($1)<=>length($2); # 0 if match [download]
Enjoy, Mickey