i was writing a whois script, all was working untill i realised that it accepted domain-.com I've never actually thought about this before, but this ISNT a valid domain, nor is -domain.com.
But while researching a few hosting companies and registras almost all of them saw a domain with a hyphen at beginning or end as a valid domain and some even saw ---.com as valid. although it isnt. There was only enom and a select few others that saw the domain as invalid.
is this a known issue that people are aware of? whoiscart is one of the many systems that accepts domains like this - I just thought i'd mention this so that people can update their ordering systems as needed as the problem seems fairly widespread.
here is an example regex if its of any use to anyone..
This matches domain-.com and -domain.com. and makes sure the domain meets the usual criteria. it doesnt however allow for the other char's which are now allowed. Like odd swedish chars and others.
i hope this helps anyone..
i've just tryed this using modernbills signup script.. this also has the same problem. (it sees -pole.com as invalid but pole-.com goes through fine)
Webair Internet Development Inc.
Shared Hosting • Managed Dedicated Servers • SEO
1.866.WEBAIR.1 • www.webair.com • 24/7/365 Support • Adult Friendly
My comments do not reflect the views of the company or its management.