matches static method

String? Function(String?) matches(
  1. Pattern pattern, {
  2. String errorMessage = 'Invalid format',
})

Ensures the string matches the given pattern.

Implementation

static String? Function(String?) matches(
  Pattern pattern, {
  String errorMessage = 'Invalid format',
}) {
  return _build(errorMessage, (v) => v.matches(pattern));
}