Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ietf-language-tag-regex

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ietf-language-tag-regex

Regular expressions for matching IETF language tags (BCP 47)

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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 = require('ietf-language-tag-regex')

languageTagRegex().test('en-GB')   // true
languageTagRegex().test('a-DE')    // false
languageTagRegex().test('zh-Hant') // 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.

Keywords

FAQs

Package last updated on 02 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc