-
Sub-task
-
Resolution: Fixed
-
P4
-
None
-
None
-
b87
-
Verified
JavaScript regular expressions support the empty character class [] which never matches. We currently mark any regexp containing an empty character class as "never matches", which may be wrong if the empty char class occurs within an alternative, negative lookahead etc.
/[]|[^]/.test("a")
=> should return true instead of false
/(?![])/.test("")
=> should return true instead of false
The most viable solution is probably to translate [] to an actual character class that never matches such as [^\w\W].
/[]|[^]/.test("a")
=> should return true instead of false
/(?![])/.test("")
=> should return true instead of false
The most viable solution is probably to translate [] to an actual character class that never matches such as [^\w\W].