function isStructurallyValidLanguageTag(locale) {
        if (!languageTagRE.test(locale)) {
            return false;
        }
        locale = locale.split(/-x-/)[0];
        return !duplicateSingletonRE.test(locale) && !duplicateVariantRE.test(locale);
    }
Verifies that the given string is a well-formed BCP 47 language tag
with no duplicate variant or singleton subtags.

Spec: ECMAScript Internationalization API Specification, draft, 6.2.2.