my $string = '00110011111110111111111111111110'; $string =~ /(1{1,}1)/; print $1, "\n"; prints 11 instead of 11111111111111111