---- var re = /=/; console.log("a = b".match(re)); ---- re = RegExp('=') console.log 'a = b'.match(re)