Regular Expressions 101

Community Patterns

1...34567...10

Hostname validation

3

Regular Expression
Golang

`
(?i)^(?:([a-z0-9-]+|\*)\.)?([a-z0-9-]{1,61})\.([a-z0-9]{2,7})$
`
gm

Description

Validates subdomain, root domain, and wild card domains

Submitted by AnonymousDapper - 7 years ago