var regex = /^[a-zA-Z0-9!@#\$%\^\&*\)\(+=._-]+$/g
function escapeRegExp(input) { const source = typeof input === 'string' || input instanceof String ? input : ''; return source.replace(/[-[/\]{}()*+?.,\\^$|#\s]/g, '\\$&'); }
// Tests website Regular Expression against document.location (current page url) if (/^https\:\/\/example\.com\/$/.exec(document.location)){ console.log("Look mam, I can regex!"); }