-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
From https://github.com/callumacrae/tryregex/blob/master/app/assets/js/globalFuncs.js#L72
data.firstEscaped = firstName.replace(/([$()*+.?\[^|\]])/g, '\\$1');
It is missing escape for {, }, \ and / (the last one for RegExp literal only). The code could be changed to:
data.firstEscaped = firstName.replace(/([$()*+.?\[^|\]{}\/\\])/g, '\\$1');
Or without using capturing group:
data.firstEscaped = firstName.replace(/[$()*+.?\[^|\]{}\/\\]/g, '\\$&');
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels