How to validate "subdomain" in atextfiled in coldfusion?
subdomain validation
Collapse
X
-
these are rules to create Sub-Domain Names
Sub-Domain Names
A Sub-Domain Name does not form part of a Registered Domain Name, therefore the rules laid down by the Registrar do not apply.
The characters you can choose from:
* A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
* 1 2 3 4 5 6 7 8 9 0
* Hyphen (-)
* An address must begin and end with an alphanumeric character. Punctuation characters must not be placed together
* Sub-Domain names can contain letters, numbers or hyphens (-), NO spaces or other characters are allowed.
me have lot fdoubts in tht...is more than 2 Hyphen possible? etc..i have to validate thesein coldfusionComment
-
ok thanks ..
i have to satisy there two condition also
*An address must begin and end with an alphanumeric character. Punctuation characters must not be placed together
* Sub-Domain names can contain letters, numbers or hyphens (-), NO spaces or other characters are allowed.
how can this also possible with ?Comment
-
The second condition is already satisfied. For the first condition, you can add a alphanumeric pattern at the beginning and the end:
Code:/^[a-z0-9][a-z0-9\-]+[a-z0-9]$/
Comment
Comment