Regex 101 Exercise I9 - Count the number of matches
Regex 101 Exercise I9 - Count the number of matches
Given a string like:
# # 4 6 # # 7 # 45 # 43 # 65 56 2 # 4345 # # 23
Count how many numbers there are in this string
Comments
Anonymous
February 28, 2006
perl -ne "$a++ while m/d+/g; print $a;"Anonymous
February 28, 2006
Spoiler warning... three different ways to do it
http://www.geocities.com/mvaneerde/regex-i9.txtAnonymous
February 28, 2006
Here's my entry in the Obfuscated Perl contest:
perl -ne "print 0+@{[/d+/g]}"Anonymous
February 28, 2006
Obfuscated Perl entry #2... mmm... signal-to-noise ratio of 7-to-1 ;)
perl -pe "$_=@{[/d+/g]}"Anonymous
February 28, 2006
er, 1-to-7 (oops)Anonymous
February 28, 2006
Thought of two more ways to do it... #4 and #5 on
http://www.geocities.com/mvaneerde/regex-i9.txtAnonymous
March 01, 2006
TrackBack From:http://sheva.cnblogs.com/archive/2006/03/01/340666.htmlAnonymous
March 06, 2006
Regex 101 Exercise I9 - Count the number of matches
Given a string like:
# # 4 6 # # 7 #...Anonymous
March 07, 2006
TrackBack From:http://sheva.cnblogs.com/archive/0001/01/01/340666.htmlAnonymous
June 07, 2009
PingBack from http://greenteafatburner.info/story.php?id=2228Anonymous
June 08, 2009
PingBack from http://quickdietsite.info/story.php?id=3973Anonymous
June 17, 2009
PingBack from http://pooltoysite.info/story.php?id=3220