Phone Number
Telephone number in various formats. Locale-specific due to digit grouping, area code positions, and formatting conventions (e.g., US +1 (xxx) xxx-xxxx vs EU +xx-xxx-xxx-xxxx). May include country code, area code, and extension.
Phone Number
identity.person.phone_numberTelephone number in various formats. Locale-specific due to digit grouping, area code positions, and formatting conventions (e.g., US +1 (xxx) xxx-xxxx vs EU +xx-xxx-xxx-xxxx). May include country code, area code, and extension.
Domain
identity
Category
person
Casts to
VARCHAR
Scope
Locale-specific
Locales
EN, EN_AU, EN_GB, EN_CA, EN_US, DE, FR, ES, IT, NL, PL, RU, JA, ZH, KO, AR, ZA, PT_BR, ES_MX, HI, ES_AR, ES_CL, ES_CO, ES_PE, SE, NO, DK, FI, CZ, HU, RO, GR, TR, IL, TH, MY, SG, PH, ID, TW, NZ, NG, PT, AT, CH, BE, IE
Try it
CLI
$ finetype infer -i "+1 (555) 123-4567"
→ identity.person.phone_numberDuckDB
Detect
SELECT finetype('+1 (555) 123-4567');
-- → 'identity.person.phone_number'Cast expression
CAST({col} AS VARCHAR)Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS VARCHAR) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'identity.person.phone_number';Struct Expansion
Expression
area_code: REGEXP_EXTRACT({col}, '[^0-9]([0-9]{3})[^0-9]')
country_code: REGEXP_EXTRACT({col}, '^\+?([0-9]{1,3})')
digits_only: REGEXP_REPLACE({col}, '[^0-9]', '')JSON Schema
finetype schema identity.person.phone_number
{
"$id": "https://meridian.online/schemas/identity.person.phone_number",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Telephone number in various formats. Locale-specific due to digit grouping, area code positions, and formatting conventions (e.g., US +1 (xxx) xxx-xxxx vs EU +xx-xxx-xxx-xxxx). May include country code, area code, and extension.",
"examples": [
"+1 (555) 123-4567",
"555-123-4567",
"+44 20 7946 0958",
"+33 1 42 68 53 00",
"07911 123456"
],
"maxLength": 30,
"minLength": 7,
"pattern": "^[+]?[0-9\\s()\\-\\./\\u2013]+([\\s]*(ext\\.?|Ext\\.?|x|#)[\\s]*\\d{1,5})?([\\s]*(Work|Cell|Fax|Home|Office))?$",
"title": "Phone Number",
"type": "string",
"x-finetype-broad-type": "VARCHAR",
"x-finetype-pii": true,
"x-finetype-transform": "CAST({col} AS VARCHAR)"
}Examples
+1 (555) 123-4567555-123-4567+44 20 7946 0958+33 1 42 68 53 0007911 123456Aliases
telephonephone