A regular expression pattern.
Regular expressions are Patterns, and can as such be used to match strings or parts of strings.
firstMatch is the main implementation method that applies a regular expression to a string and returns the first Match. All other methods in RegExp can build on it.
Use allMatches to look for all matches of a regular expression in a string.
The following example finds all matches of a regular expression in a string.
RegExp exp = new RegExp(r"(\w+)"); String str = "Parse my string"; Iterable<Match> matches = exp.allMatches(str);
Note the use of a raw string (a string prefixed with
in the example above. Use a raw string to treat each character in a string
as a literal character.
- Implemented types
- isCaseSensitive → bool
Whether this regular expression is case sensitive. [...]
- isMultiLine → bool
Whether this regular expression matches multiple lines. [...]
- pattern → String
The source regular expression string used to create this
- hashCode → int
The hash code for this object. [...]
- runtimeType → Type
A representation of the runtime type of the object.
String input, [ int start = 0 ]) → Iterable< Match>
Returns an iterable of the matches of the regular expression on
String input) → Match
Searches for the first match of the regular expression
in the string
nullif there is no match.
String input) → bool
Returns whether the regular expression has a match in the string
String input) → String
Returns the first substring match of this regular expression in
String string, [ int start = 0 ]) → Match
Match this pattern against the start of
Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
) → String
Returns a string representation of this object.
dynamic other) → bool
The equality operator. [...]