You are here

function _uk_phone_rules in Phone Number 6

Same name and namespace in other branches
  1. 7 includes/phone.gb.inc \_uk_phone_rules()

@file CCK Field for United Kingdom phone numbers.

3 calls to _uk_phone_rules()
gb_formatter_default in includes/phone.gb.inc
Default formatter for international phone number.
gb_formatter_local in includes/phone.gb.inc
Local formatter for local phone number.
gb_validate_number in includes/phone.gb.inc
Validate country level phone number.

File

includes/phone.gb.inc, line 8
CCK Field for United Kingdom phone numbers.

Code

function _uk_phone_rules() {

  // TODO: more detailed check by area codes
  return '/^
      0*(2[03489])(\\d{4})(\\d{4})    # 02x [eight-digit local number]
      |
      0*(11[3-8])(\\d{3})(\\d{4})     # 011x [seven-digit local number]
      |
      0*(1[2-9]1)(\\d{3})(\\d{4})     # 01x1 [seven-digit local number]
      |
      0*(1[2-9][0|2-9]\\d)(\\d{5,6})  # 01xxx [mostly six-digit local numbers] (but not 01x1 codes)
    $/x';
}