findNumbers method

Iterable<PhoneNumberMatch> findNumbers(
  1. String text,
  2. String defaultRegion, [
  3. Leniency leniency = Leniency.valid,
  4. Int64 maxTries = Int64.MAX_VALUE,
])

Returns an iterable over all PhoneNumberMatch PhoneNumberMatches in text.

text the text to search for phone numbers, null for no text defaultRegion region that we are expecting the number to be from. This is only used if the number being parsed is not written in international format. The country_code for the number in this case would be stored as that of the default region supplied. May be null if only international numbers are expected. leniency the leniency to use when evaluating candidate phone numbers maxTries the maximum number of invalid numbers to try before giving up on the text. This is to cover degenerate cases where the text has a lot of false positives in it. Must be code >= 0.

Implementation

Iterable<PhoneNumberMatch> findNumbers(
  String text,
  String defaultRegion, [
  Leniency leniency = Leniency.valid,
  Int64 maxTries = Int64.MAX_VALUE,
]) {
  return PhoneNumberMatcher(this, text, defaultRegion, leniency, maxTries);
}