Write efficient, error-free and safe regular expressions in JavaScript and TypeScript

Hello,

On top of these rules, we added 8 more to really make sure you have efficient and error-free regexp.
Here is the list of added rules.

Bug Detections:

  • S6351: Regular expressions with the global flag should be used with caution
  • S5867: Regular expressions with Unicode property escapes should set Unicode flag
  • S5842: Repeated patterns in regular expressions should not match the empty string

Code Smell Detections:

  • S5869: Character classes in regular expressions should not contain the same character twice
  • S6019: Reluctant quantifiers in regular expressions should be followed by an expression that can’t match the empty string
  • S5843: Regular expressions should not be too complicated
  • S6353: Regular expression quantifiers and character classes should be used concisely

Security Hotspots Detection:

  • S5852: Using slow regular expressions is security-sensitive

Alex