String representing a regular expression.
Safer than string and simpler than RegExp type to represent a regular expression. It RegularExpression to enforce flags to always have u and have a consistent order.
string
RegExp
RegularExpression
u
const regex: RegularExpression = "/^[a-z]+$/u"; Copy
const regex: RegularExpression = "/^[a-z]+$/u";
String representing a regular expression.
Remarks
Safer than
string
and simpler thanRegExp
type to represent a regular expression. ItRegularExpression
to enforce flags to always haveu
and have a consistent order.Example
See