var url = "modules/content/index.php?act=category&id=$1"; url = url.replace(new RegExp("\\$1",'g'),"abx"); alert("NO: " + url );