LanguageInterface::VALID_LANGCODE_REGEX
Same name in other branches
- 9 core/lib/Drupal/Core/Language/LanguageInterface.php \Drupal\Core\Language\LanguageInterface::VALID_LANGCODE_REGEX
- 8.9.x core/lib/Drupal/Core/Language/LanguageInterface.php \Drupal\Core\Language\LanguageInterface::VALID_LANGCODE_REGEX
- 10 core/lib/Drupal/Core/Language/LanguageInterface.php \Drupal\Core\Language\LanguageInterface::VALID_LANGCODE_REGEX
A regex for validating language codes according to W3C specifications.
See also
https://www.w3.org/International/articles/language-tags/
File
-
core/
lib/ Drupal/ Core/ Language/ LanguageInterface.php, line 61
Class
- LanguageInterface
- Defines an interface for languages.
Namespace
Drupal\Core\LanguageCode
const VALID_LANGCODE_REGEX = '[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*';
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.