isPhone method

bool isPhone()

Phone Number regex

Must be started either with "0", "+", "+XX <X between 2 to 4 digit>", or "(+XX <X between 2 to 3 digit>)" It is possible to add whitespace separating digit with "+" or "(+XX)"

Examples:

  • 05555555555
  • +555 5555555555
  • (+123) 5555555555
  • (555) 5555555555
  • +5555 5555555555

Implementation

bool isPhone() => RegVal.hasMatch(
      this,
      RegexPattern.phone,
    );