sub belongs_to_L { my ($s) = @_; my ($num_zeros,$num_ones,$junk); ($num_zeros,$num_ones,$junk) = ( $s =~ m/^(0*)(1*)(.*)/); return 1 if ( length($zeros) == length($ones) and length($junk) == 0); return 0; }
In reply to Re: A (non) reg-ex question
by Anonymous Monk
in thread A (non) reg-ex question
by Ido
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |