I am using Dev tools in Google chrome and need to find out is the site url contains a specific string. I am able to get Url_Str correctly, although when I run the match command it always returns a match found even when it is not valid . How do I correct this?
let Url_Str = ___grecaptcha_cfg.clients[0].B.S.baseURI;
if (Url_Str.match(/*myconstant*/)) {"match found";}
Also is there a Alternate way to get the site url instead of using grecaptcha_cfg?
const c = window.location.href
const regex =/forum|com|site/gi; //add more than one word after |
regex.test(c) //true - u can use one
const found = c.match(regex); //["forum", "site"]