I notice by doing a basic grep through the source that sexeger may be useful in speeding things up. I just found it myself and had some fun :-)
http://www.crusoe.net/~jeffp/sexeger/sexeger.html Cheers Robert (who offers no source I'm afraid - in fact, I'm very afraid of such nasty regexps!)
