• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • None
    • core-libs
    • 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].

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: