Checks that the input contains UK telephone numbers.
1 2 3 4 5 6 7
Input to check.
A logical value. If
How severe should the consequences of the assertion be?
TRUE if the input string
contains a valid UK telephone number. The assert_* function returns nothing
but throws an error when the
is_* function returns
The function doesn't guarantee that the phone number is in use, but checks that the format is correct, and that the area code exists. Spaces, hyphens and round brackets are allowed to appear in arbitrary places. The international UK prefix of 0044 or +44 is allowed.
The regex is adapted from one on the now defunct aa-asterisk.org.uk site with some additional consultation from https://en.wikipedia.org/wiki/List_of_United_Kingdom_dialling_codes
1 2 3