function regexpEscape(hardcoded, ...unescaped) {
	return unescaped.reduce(
		(accumulated, value, index) =>
			`${accumulated}${value.replace(
				/[!$()*+./:=?[\\\]^{|}]/g,
				(character) => `\\${character}`,
			)}${hardcoded[index + 1]}`,
		hardcoded[0],
	);
}
/**
 * Tagged template litteral function to escape a dynamic regular expression value.
 *
 * @param {TemplateStringsArray} hardcoded - Hardcoded values to keep as is.
 * @param {...string} unescaped - Strings to escape before adding back in.
 *
 * @returns {string} - The escaped string.
 */
Tagged template litteral function to escape a dynamic regular expression value.
@param {TemplateStringsArray} hardcoded - Hardcoded values to keep as is.
@param {...string} unescaped - Strings to escape before adding back in.

@returns {string} - The escaped string.
Tagged template litteral function to escape a dynamic regular expression value . @param { TemplateStringsArray } hardcoded - Hardcoded values to keep as is . @param { ... string } unescaped - Strings to escape before adding back in . @returns { string } - The escaped string .
function regexpEscape(hardcoded, ...unescaped) {
	return unescaped.reduce(
		(accumulated, value, index) =>
			`${accumulated}${value.replace(
				/[!$()*+./:=?[\\\]^{|}]/g,
				(character) => `\\${character}`,
			)}${hardcoded[index + 1]}`,
		hardcoded[0],
	);
}
function regexpEscape ( hardcoded , ... unescaped ) { return unescaped . reduce ( ( accumulated , value , index ) => ` ${ accumulated } ${ value . replace ( / [!$()*+./:=?[\\\]^{|}] / g , ( character ) => ` \\ ${ character } ` , ) } ${ hardcoded [ index + 1 ] } ` , hardcoded [ 0 ] , ) ; }
Tagged template litteral function to escape a dynamic regular expression value.
Tagged template litteral function to escape a dynamic regular expression value .