Matching a Forward Slash with a regex

You can escape it like this.

/\//ig; //  Matches /

or just use indexOf

if(str.indexOf("https://stackoverflow.com/") > -1)

Leave a Comment