exec function

List<String?>? exec(
  1. RegExp regex,
  2. String str
)

RegEx

Implementation

List<String?>? exec(RegExp regex, String str) {
  var m = regex.firstMatch(str);
  if (m == null) {
    return null;
  }

  var groups = <int>[];
  for (var i = 0; i <= m.groupCount; i++) {
    groups.add(i);
  }

  var retVal = m.groups(groups);
  return retVal;
}