Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: repeated characters in regular expressions

by Utilitarian (Vicar)
on Aug 01, 2013 at 07:54 UTC ( #1047383=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047383]
[Discipulus]: ah! holidays i hope..
Discipulus without Corion and with choroba in another timezone the monastery was silent.. I was silbing alone in the cloister
[choroba]: Yes, I feel alone in the cyberspace...
[choroba]: Not many occasions to talk to my wife, either :-(
Discipulus s/silbing/whistle/ dunno from where this word was in my mind..

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-02-22 08:42 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (325 votes). Check out past polls.