ffxiv-wiki-scripts/lib/util/regexp.js

6 lines
171 B
JavaScript

/**
* @see https://stackoverflow.com/a/6969486
* @param {string}
* @returns {string}
*/
export const regExpEscape = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');