Reputation: 1391
So far I've got the following regex that matches against regular domains but not domains with underscores. Example: _tcp._sip.45.example.com. Any help would be greatly appreciated.
(?P<name>([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6})
Upvotes: 0
Views: 1440
Reputation: 2096
\b((xn--)?[a-z0-9\w]+(-[a-z0-9]+)*\.)+[a-z]{2,}\b
try this one, or stick with yours, basicaly \w is what you add for underscore.
Upvotes: 3