Someone in IRC mentioned parsing out a domain name using python, which should be pretty easy. I looked up some old py code from sometime ago and this should work, at least it did when I needed it to:
Outputs:
somedomain.co.uk
You can embed additional re.subs to eliminate other modifiers such as forum. etc, but you only need to do the text.lower() once at the tail end.
Hope this helps