is_valid_locale
Validates whether a given locale string matches a specific format using regular expressions.
def is_valid_locale(
locale: string
) - > re.Match | None
Validates whether a given string conforms to a standard locale format, ensuring it matches either a simple language code or a language-region combination.
Parameters
| Name | Type | Description |
|---|---|---|
| locale | string | The locale identifier string to be validated, such as a language code or a language-country pair. |
Returns
| Type | Description |
|---|---|
| `re.Match | None` |