phone constant

Pattern const phone

Phone Number regex Must started by either, "0", "+", "+XX <X between 2 to 4 digit>", "(+XX <X between 2 to 3 digit>)" Can add whitespace separating digit with "+" or "(+XX)" Example: 05555555555, +555 5555555555, (+123) 5555555555, (555) 5555555555, +5555 5555555555

Implementation

static const Pattern phone =
    r'^(0|\+|(\+[0-9]{2,4}|\(\+?[0-9]{2,4}\)) ?)([0-9]*|\d{2,4}-\d{2,4}(-\d{2,4})?)$';