in reply to Counting frequency of the regex matches
See also this node of mine for another similar way to do it.
--MidLifeXis