Escapes a string for use in a regular expression.
To convert.
Escaped string.
export function escRegExp( str: string ): string { return str.replace( /[.*+?^${}()|[\]\\]/g, '\\$&' );} Copy
export function escRegExp( str: string ): string { return str.replace( /[.*+?^${}()|[\]\\]/g, '\\$&' );}
new RegExp( `^${ escRegExp( filePath ) }\\/.+`, 'g' ); Copy
new RegExp( `^${ escRegExp( filePath ) }\\/.+`, 'g' );
0.1.0
Escapes a string for use in a regular expression.