Implemented optional subdomains with regex