Nameserver regular expression improvements
===

I have the following simple regular expression for nameservers:

    ^[a-zA-Z0-9]+\.[a-zA-Z0-9]+\.[a-zA-Z0-9\.]+

I would like to improve this by

 - Limiting the number of . in the last portion to a maximum of 1 (to
   allow for .co.uk, but restricting invalid domains)
 - Not allowing the first section to be www

Can anyone provide some assistance?