Page MenuHomeSoftware Heritage

index.js
No OneTemporary

index.js

"use strict";
/**
* RegexEscape
* Escapes a string for using it in a regular expression.
*
* @name RegexEscape
* @function
* @param {String} input The string that must be escaped.
* @return {String} The escaped string.
*/
function RegexEscape(input) {
return input.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
/**
* proto
* Adds the `RegexEscape` function to `RegExp` class.
*
* @name proto
* @function
* @return {Function} The `RegexEscape` function.
*/
RegexEscape.proto = function () {
RegExp.escape = RegexEscape;
return RegexEscape;
};
module.exports = RegexEscape;

File Metadata

Mime Type
text/plain
Expires
Jul 4 2025, 9:35 AM (5 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3327870

Event Timeline