Skip to content

Files

Latest commit

 

History

History
21 lines (14 loc) · 446 Bytes

valid_regexps.md

File metadata and controls

21 lines (14 loc) · 446 Bytes

Pattern: Invalid regular expression

Issue: -

Description

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()'));

Further Reading