I'm trying to match a hostname input with the following properties:
a-z A-Z 0-9 : - are allowed ;
doesnot start or end with - ;
"." can be used to separate different labels of the hostname.
But gives no match for this regex:
^(a-zA-Z0-9|(?<!-)\.(?![-.]))[a-zA-Z0-9]+)?)$ ...
Submitted by Revathy - 11 years ago