Open
Description
Description of the false positive
Earlier, a colleague of mine filed #18721 regarding adding support for the v
flag. That was implemented but it seems like there's some false positives without properly handling of the set operations.
More specifically, the regex below fails with the ID js/regex/duplicate-in-character-class
since it believes [\S--[\[\]]]
is a character class that contains brackets ([]
) twice.
Code samples or links to source code
const regex = /\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv;
URL to the alert on GitHub code scanning (optional)
https://github.com/mozilla/pdf.js/security/code-scanning/1003
Activity