js-regex-pl

1.0.1 • Public • Published

js-regex-pl

JavaScript RegExp doesn't work with Unicode characters out of the box. This small package fixes this issue.

This is \p{L} equalent extracted from XRegExp

XRegExp is a great library but I wanted something much smaller for my needs.

Installation

npm i js-regex-pl

Usage

import pL from 'js-regex-pl';

new RegExp(`^[${pL}]+$`).test('日本語')

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    7,723
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    7,723
  • 1.0.0
    11,909

Package Sidebar

Install

npm i js-regex-pl

Weekly Downloads

4,981

Version

1.0.1

License

ISC

Unpacked Size

10.1 kB

Total Files

6

Last publish

Collaborators

  • yury-dymov