Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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."


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047383]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2015-07-08 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls