ietf-language-tag-regex
Regular expressions for matching IETF language tags (BCP 47)
Based on this Stack Overflow comment by George Pollard.
Install
Usage
const languageTagRegex = // true // false // true
API
languageTagRegex(options)
Returns a regex for matching IETF language tags.
options
exact
Type: boolean
Default: true
Only match an exact string. Useful with RegExp#test
to check if a string is a language tag.