Files
30-seconds-of-code/node_modules/@hapi/hoek/lib/escapeRegex.js
2019-08-20 15:52:05 +02:00

12 lines
198 B
JavaScript
Executable File

'use strict';
const internals = {};
module.exports = function (string) {
// Escape ^$.*+-?=!:|\/()[]{},
return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
};