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."
Comment on
Re: repeated characters in regular expressions
Select
or
Download
Code
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.
[reply]
In Section
Seekers of Perl Wisdom