in reply to matching digits
And this code looks exactly like neilwatson's answer here.
It looks like it should work fine, by the way. How do you know it doesn't?
-sauoq "My two cents aren't worth a dime.";