hasMatch method Null safety

bool hasMatch(
  1. String pattern,
  2. String input,
  3. {bool caseSensitive = true}
)

helper function to check if an input matches a given pattern

Implementation

bool hasMatch(String pattern, String input, {bool caseSensitive: true}) =>
    RegExp(pattern, caseSensitive: caseSensitive).hasMatch(input);