hasMatch method Null safety

bool hasMatch(
  1. String input
)

Whether the regular expression has a match in the string input.

var string = 'Dash is a bird';
var regExp = RegExp(r'(humming)?bird');
var match = regExp.hasMatch(string); // true

regExp = RegExp(r'dog');
match = regExp.hasMatch(string); // false

Implementation

bool hasMatch(String input);