http://qs321.pair.com?node_id=1047383


in reply to repeated characters in regular expressions

Something like the following $string=~s/(.){$n}/$1 x $m /eg;

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Replies are listed 'Best First'.
Re^2: repeated characters in regular expressions
by Loops (Curate) on Aug 01, 2013 at 08:03 UTC
    The (.){$n} construct will match any sequence of $n characters, not just repeating characters.