http://www.perlmonks.org?node_id=966953


in reply to substr regex alternative

print $string =~ /^.{6}(.{1,5})/s;