I want to be able to parse any url with ruby to get the main part of the domain without the www (just the XXXX.com)
www
if the URL is in format http://www.google.com, then you could do something like:
http://www.google.com
a = 'http://www.google.com' puts a.split(/\./)[1] + '.' + a.split(/\./)[2]
Or
a =~ /http:\/\/www\.(.*?)$/ puts $1