ibm-js / ecma402

ECMA-402 JavaScript Internationalization API "shim"
Other
34 stars 21 forks source link

Regex pattern used for region tag in CanonicalizeLanguageTag #69

Closed yumaoka closed 9 years ago

yumaoka commented 10 years ago

In CanonicalizeLanguageTag:

[https://github.com/ibm-js/ecma402/blob/master/impl/common.js#L183]

var regionTag = /(?:-)([a-z]{2})(?=(-|$))/g;

This regex pattern would not be sufficient to parse a region subtag with 3 letter numeric code (such as 419).