I have a code here but always result to "alert(2)". Help me correct my code on url matching using regex global
var curl = document.URL;
var burl = document.location;
var ctitle = document.title;
var url = /"catalogsearch\/advanced"/g;
if(curl.match(url) == true) {
alert(1);
} else {
alert(2);
}