firstMatch method

  1. @override
RegExpMatch? firstMatch(
  1. String input
)
override

Finds the first match of the regular expression in the string input.

Returns null if there is no match.

final string = '[00:13.37] This is a chat message.';
final regExp = RegExp(r'c\w*');
final match = regExp.firstMatch(string)!;
print(match[0]); // chat

Implementation

@override
RegExpMatch? firstMatch(String input) => _toRegExp().firstMatch(input);