technology.code.locale_codeLanguage-region code in IETF BCP 47 format (e.g., en-US, fr-FR, zh-Hans). Allows for script subtags (e.g., zh-Hant) and extensions.
$ finetype infer -i "en"
→ technology.code.locale_codeSELECT finetype('en');
-- → 'technology.code.locale_code'CAST({col} AS VARCHAR)-- 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) = 'technology.code.locale_code';country: REGEXP_EXTRACT(LOWER({col}), '-([a-z]{2})(?:$|-)')
language: REGEXP_EXTRACT(LOWER({col}), '^([a-z]{2,3})'){
"$id": "https://meridian.online/schemas/technology.code.locale_code",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Language-region code in IETF BCP 47 format (e.g., en-US, fr-FR, zh-Hans). Allows for script subtags (e.g., zh-Hant) and extensions.",
"examples": [
"en",
"en-US",
"fr-FR",
"zh-Hans-CN",
"de-AT"
],
"pattern": "^[a-zA-Z]{2,3}(?:[-_][a-zA-Z]{2,4})*$",
"title": "Locale Code",
"type": "string",
"x-finetype-broad-type": "VARCHAR",
"x-finetype-transform": "CAST({col} AS VARCHAR)"
}enen-USfr-FRzh-Hans-CNde-AT