$ perl -Mstrict -wE 'my $str = "foobar"; say 1 if $str =~ /[o]{1,2}/' 1