length method

int length()

Returns the length of the last match.

Implementation

int length() {
  var rc = 0;
  switch (type) {
    case LastMatchType.undef:
      break;
    case LastMatchType.regularExpr:
      rc = regExpMatch!.group(0)!.length;
      break;
    case LastMatchType.string:
      rc = stringMatch!.length;
      break;
  }
  return rc;
}