isPhoneNumber method

bool isPhoneNumber(
  1. String s
)

Checks if string is phone number.

Implementation

static bool isPhoneNumber(String s) => hasMatch(s,
    r'^(0|\+|(\+[0-9]{2,4}|\(\+?[0-9]{2,4}\)) ?)([0-9]*|\d{2,4}-\d{2,4}(-\d{2,4})?)$');