regEx1 function

String? regEx1(
  1. String pattern,
  2. String source
)

Returns the first match

Implementation

String? regEx1(String pattern, String source) {
  var rgx = RegExp(pattern);
  var first = rgx.firstMatch(source);
  if (first == null) //
    return "";

  return first[0];
}