RegExpPatterns class abstract final

A collection of pre-built, commonly used RegExp patterns.

Use these to avoid rewriting the same validation regexes across projects.

RegExpPatterns.email.hasMatch('user@example.com') // true
RegExpPatterns.uuid.hasMatch('550e8400-e29b-41d4-a716-446655440000') // true

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

alpha RegExp
Matches a string containing only alphabetic characters.
final
alphanumeric RegExp
Matches a string containing only alphanumeric characters.
final
creditCard RegExp
Matches common credit card numbers (Visa, MasterCard, Amex, Discover).
final
digits RegExp
Matches a string containing only digits (0–9).
final
email RegExp
Matches a valid email address.
final
hexColor RegExp
Matches a hex color code (#RGB or #RRGGBB, with or without #).
final
ipv4 RegExp
Matches a valid IPv4 address.
final
ipv6 RegExp
Matches a valid IPv6 address (simplified).
final
phone RegExp
Matches common phone number formats (E.164 and regional variants).
final
postalCode RegExp
Matches a US ZIP code (5 digits or ZIP+4).
final
semver RegExp
Matches a semantic version string (e.g. 1.2.3 or 1.2.3-beta.1).
final
slug RegExp
Matches a URL-friendly slug (lowercase letters, digits, hyphens).
final
strongPassword RegExp
Matches a strong password: ≥8 chars, uppercase, lowercase, digit, special.
final
url RegExp
Matches an http or https URL.
final
uuid RegExp
Matches a UUID v4 (case-insensitive).
final