Well, a site name
can't have just any printable character. There are specifications.
It would be easier to put a separator of some kind so you can just explode it or split it or something. But if you want to keep it like that, you can check based on tlds.
Also, with regular expressions, any character is represented by a dot: .