RecursiveRegex class

An implementation of RegExp that isolates delimited blocks of text and applies the delimiter pattern to each block separately.

Implemented types
Annotations
  • @immutable

Constructors

RecursiveRegex({required Pattern startDelimiter, required Pattern endDelimiter, Pattern? inverseMatch, Pattern? prepended, Pattern? appended, String? captureGroupName, bool multiLine = false, bool caseSensitive = true, bool unicode = false, bool dotAll = false, bool global = false})
An implementation of RegExp that isolates delimited blocks of text and applies the delimiter pattern to each block separately.

Properties

appended Pattern?
A Pattern expected to follow endDelimiter.
final
captureGroupName String?
If not null, the block of text captured within the delimiters will be captured in a group named this.
final
endDelimiter Pattern
The closing delimiter.
final
global bool
If true, every block of delimited text, nested or not, will be matched. If false, only top-level blocks of delimited text will be matched.
final
hashCode int
The hash code for this object.
no setteroverride
inverseMatch Pattern?
If provided, only matches that match this Pattern and aren't delimited will be matched by this regex.
final
isCaseSensitive bool
Whether this regular expression is case sensitive.
final
isDotAll bool
Whether "." in this regular expression matches line terminators.
final
isMultiLine bool
Whether this regular expression matches multiple lines.
final
isUnicode bool
Whether this regular expression uses Unicode mode.
final
pattern String
The pattern applied to delimited blocks of text.
no setteroverride
prepended Pattern?
A Pattern expected to precede startDelimiter.
final
regExp RegExp
The RegExp applied to delimited blocks of text.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startDelimiter Pattern
The opening delimiter.
final

Methods

allMatches(String input, [int start = 0]) List<RegExpMatch>
Returns a list of every match found in input after start.
override
copyWith({RegExp? startDelimiter, RegExp? endDelimiter, String? captureGroupName, bool? isMultiLine, bool? isCaseSensitive, bool? isUnicode, bool? isDotAll, bool? global, bool copyNull = false}) RecursiveRegex
Returns a copy of RecursiveRegex, updating any values provided by this.
endsWith(String input) bool
Returns true if input ends with this pattern, otherwise returns false.
firstMatch(String input) RegExpMatch?
Finds the first match of the regular expression in the string input.
override
getMatches(String input, {int start = 0, int? stop, bool reverse = false}) List<RegExpMatch>?
Returns a list of the matches found in input.
hasMatch(String input) bool
Checks whether this regular expression has a match in the input.
override
lastMatch(String input) RegExpMatch?
Returns the last match found in input.
matchAsPrefix(String string, [int start = 0]) Match?
Match the delimited pattern against the string at the position of start.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nthMatch(int index, String input, {bool reverse = false}) RegExpMatch?
Searches input for the match found at index. Returns null if one isn't found.
startsWith(String input) bool
Returns true if input starts with this pattern, otherwise returns false.
stringMatch(String input) String?
Finds the string of the first match of this regular expression in input.
override
stringMatches(String input, {int start = 0, int? stop, bool reverse = true}) List<String>?
Returns the list of substring matches found in input.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object o) bool
The equality operator.
override