Every line of 'regex for website url' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
35 function isGuardianWebsiteUrl(url: string) { 36 return matchHostname(url, [ 37 urlConstants.base.mainDomain, 38 urlConstants.base.mainDomainShort 39 ]); 40 }
36 function subdomainRegex(baseUrl){ 37 var regex; 38 39 baseUrl = _escapeRegExp(baseUrl); 40 41 regex = new RegExp('((?!www)\\b[-\\w\\.]+)\\.' + baseUrl + '(?::)?(?:\d+)?'); 42 43 return regex; 44 }