This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Description
I’m currently using this function to escape plain text – which will have to change(?)
export function escapeForRegExp(str: string) {
return str.replace(/[\\^$.*+?()\[\]{}|=!<>:\-]/g, '\\$&');
}
It may make sense to show an implementation of such a function in this proposal or to link to one elsewhere.