I am attempting to exclude all subdomains but still allow www. (optional) And then anything after the domain name is optionally allowed
Here is what I'm looking for:
www.domain.com // true
domain.com // true
sub.domain.com // false
domain.com/hello // true
www.domain.com/hello // true
Here is what I have:
^(?i)(?:www\.)?domain.com.*
This is still allowing other subdomains.
I have tried
^(?i)(?:www\.)(?![-\w.])?domain.com.*
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.