Class RegexBasedMatcher

java.lang.Object
com.google.i18n.phonenumbers.internal.RegexBasedMatcher
All Implemented Interfaces:
MatcherApi

public final class RegexBasedMatcher extends Object implements MatcherApi
Implementation of the matcher API using the regular expressions in the PhoneNumberDesc proto message to match numbers.
  • Method Details

    • create

      public static MatcherApi create()
    • matchNationalNumber

      public boolean matchNationalNumber(CharSequence number, Phonemetadata.PhoneNumberDesc numberDesc, boolean allowPrefixMatch)
      Description copied from interface: MatcherApi
      Returns whether the given national number (a string containing only decimal digits) matches the national number pattern defined in the given PhoneNumberDesc message.
      Specified by:
      matchNationalNumber in interface MatcherApi