Packages
A spellchecker for Elixir, made with Bun and cspell
Current section
Files
Jump to
Current section
Files
priv/bun/node_modules/cspell-lib/dist/lib/util/regexHelper.js
/**
* Escape a string so it can be used as an exact match within a RegExp.
* @param s - string to escape
* @returns - the escaped string.
*/
export function escapeRegEx(s) {
return s.replaceAll(/[|\\{}()[\]^$+*?.]/g, '\\$&').replaceAll('-', '\\x2d');
}
//# sourceMappingURL=regexHelper.js.map