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.

Usage no npm install needed!

<script type="module">
  import jsRegexPl from 'https://cdn.skypack.dev/js-regex-pl';
</script>

README

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}]+

	
		
		
		
		
		
		
		
	npm:js-regex-pl | Skypack
	
		
		
		
		).test('日本語')