UNPKG
brazilianutils
Version:
latest (0.0.3)
0.0.3
0.0.2
0.0.1
Lots of utilities for Node.js
github.com/giovannifersan/brazilianutils
giovannifersan/brazilianutils
brazilianutils
/
lib
/
regExpUtils.js
9 lines
(6 loc)
•
240 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
'use strict'
;
module
.
exports
.
__name
=
'RegExp'
;
module
.
exports
.
escape
=
function
(
regExpString
) {
var
regexpSpecialChars =
/([\[\]\^\$\|\(\)\\\+\*\?\{\}])/gi
;
return
new
RegExp
(regExpString.
replace
(regexpSpecialChars,
'\\$1'
)); };