Pattern: Invalid regular expression
Issue: -
Regular expressions created with invalid syntax will throw a FormatException
at runtime so should be avoided.
Example of incorrect code:
print(RegExp('(').hasMatch('foo()'));
Example of correct code:
print(RegExp('[(]').hasMatch('foo()'));