so, my URL is example.com/?ref=person
but ref is null after the regex. What am I doing wrong here?
function getReferer(){
var regex = new RegExp(/ref=(.+)/);
var ref = regex.exec(window.location.ref);
alert(ref);
if (ref == null) return "";
else return ref[1];
}