my $hyphens = length $1 if $str =~ m{\A(-*)};