I have this Javascript I found and have to use but I don't understand what it is doing. Specifically, the regexp_quote() function. Can anyone help me understand what it would be trying to do here? It appears to be doing nothing but there might be some scenario where it actually does something.
function replace(input, pattern, flags, str){
return input.replace(new RegExp(regexp_quote(pattern), flags), str);
}
function regexp_quote(str) {
return str.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
}
var dateTime = "2016-03-09T13:18:21-05:00"
dateTime.replace(new RegExp(regexp_quote(':'), 'g'), '.')