possibly a fix for http://bytes.com/topic/python/answers/28054-regex-searching-hangs