mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-23 06:25:10 +08:00
This was re-implemented in a number of places - it makes more sense as a utility function.
3 lines
142 B
JavaScript
Vendored
3 lines
142 B
JavaScript
Vendored
export default function escapeRegExp(string) {
|
|
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
|
}
|