What I currently have...
^((([A-Za-z])+([A-Za-z0-9\-])*([a-zA-Z0-9])+)*\.)+$
Rules:
- The first char must either be a "." or [a-zA-Z] (it can only be "." if the string is of length 1)
- It must end in a "."
- before any "." there can only be [a-zA-Z0-9]
- other than a-zA-Z0-9 and . there can be - (hyphens) that is the only otther character set value
- after any "." there can not be a "-"
examples that should match:
.
a.
a-9.
abc.
abc.a-c.abc.
that should not match:
-.
-a.
a-.
a
abc.-bc
ab-.abc
abc.a-@c
..
currently it does not match a. which is one of the simplest cases. Do you have any suggestions on how to fix it?