Socket
Socket
Sign inDemoInstall

ietf-language-tag-regex

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ietf-language-tag-regex

Regular expressions for matching IETF language tags (BCP 47)


Version published
Weekly downloads
1.1K
decreased by-9.23%
Maintainers
1
Install size
610 kB
Created
Weekly downloads
 

Changelog

Source

0.0.5 (2017-03-02)

<a name="0.0.4"></a>

Readme

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

Last updated on 02 Mar 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc