Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

xregexp-plugin-hanzi-cjk

bluelovers131ISC1.0.56TypeScript support: included

add regexp-cjk plugin for xregexp, make xregexp auto match chinese/japanese hanzi.

chinese, cjk, hanzi, jp, regex, regexp, regexp-cjk, regular expression, xregexp, zh

readme

xregexp-plugin-hanzi-cjk

add regexp-cjk plugin for xregexp, make xregexp auto match chinese/japanese hanzi.

see regexp-cjk

demo

import addSupportToXRegExp, { IOptions, createXRegExp } from 'xregexp-plugin-hanzi-cjk';
import XRegExp from 'xregexp';
let options: IOptions = {
    // set a flag if u only wanna trigger for this plugin, default is auto enable
    //flags: 'u',
};

console.log(XRegExp.version);

// if didn't set xr, it is XRegExp
const xr1 = addSupportToXRegExp(null, options);
//const xr2 = addSupportToXRegExp(XRegExp, options);
//console.log('xr1 = xr2 = XRegExp', xr1 === xr2);

// XRegExp only work when input pattern is string
let r1 = '(の|像)';
let r2 = /(の|像)/;

let x1 = xr1(r1);

console.log(x1);
console.log(x1.test('象'));
console.log(x1.test('的'));

// this allow u input a RegExp
let x3 = createXRegExp(r2);

console.log(x3);
console.log(x3.test('象'));
console.log(x3.test('的'));

// @BUG current XRegExp not support input pattern ia a RegExp object
let x2 = xr1(r2);

console.error(x2);
console.error(x2.test('象'));
console.error(x2.test('的'));

output

4.1.1
{ /([の之的]|[像象])/ xregexp: { captureNames: null, source: '(の|像)', flags: '' } }
true
true
{ /([の之的]|[像象])/ xregexp: { captureNames: null, source: '(の|像)', flags: '' } }
true
true
{ /(の|像)/ xregexp: { captureNames: null, source: null, flags: null } }
false
false

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.56 (2025-03-12)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.55 (2024-09-03)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.54 (2024-09-02)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.53 (2024-08-24)

🛠 Build System

1.0.52 (2024-03-01)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.51 (2024-02-28)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.50 (2024-01-29)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.49 (2023-02-28)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.48 (2022-10-29)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.47 (2022-10-26)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.46 (2022-10-16)

📦 Code Refactoring

📚 Documentation

🚨 Tests

📌 Dependencies

1.0.45 (2022-02-04)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.44 (2022-02-04)

🔖 Miscellaneous

1.0.43 (2022-02-04)

🛠 Build System

1.0.42 (2021-12-08)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.41 (2021-12-02)

🔖 Miscellaneous

1.0.40 (2021-12-02)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.39 (2021-11-14)

🔖 Miscellaneous

1.0.38 (2021-11-14)

🔖 Miscellaneous

1.0.37 (2021-11-14)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.36 (2021-11-02)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.35 (2021-08-13)

♻️ Chores

1.0.34 (2021-07-28)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.33 (2021-07-26)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.32 (2021-07-09)

🔖 Miscellaneous

1.0.31 (2021-07-09)

🛠 Build System

1.0.30 (2021-06-21)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.29 (2021-06-21)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.28 (2021-06-21)

💎 Styles

1.0.27 (2021-02-04)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.26 (2020-11-29)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.25 (2020-11-10)

🔖 Miscellaneous

1.0.24 (2020-11-10)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.23 (2020-09-01)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.22 (2020-08-31)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.21 (2020-08-26)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.20 (2020-08-17)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.19 (2020-08-13)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.18 (2020-08-11)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.17 (2020-08-11)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.16 (2020-08-03)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.15 (2020-08-02)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.14 (2020-08-01)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.13 (2020-07-27)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.12 (2020-07-24)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.11 (2020-07-23)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.10 (2020-07-19)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.9 (2020-07-19)

🔖 Miscellaneous

1.0.8 (2020-07-19)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.7 (2020-07-08)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.6 (2020-07-07)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.5 (2020-07-06)

Note: Version bump only for package xregexp-plugin-hanzi-cjk

1.0.4 (2020-07-05)

🔖 Miscellaneous

1.0.3 (2020-07-05)

✨ Features

1.0.2 (2020-07-04)

🔖 Miscellaneous

1.0.1 (2020-07-04)

✨ Features

  • subtree add xregexp-plugin-hanzi-cjk (408acec)

🔖 Miscellaneous

  • Add 'packages/xregexp-plugin-hanzi-cjk/' from commit '0590c2f04e192f6968653f3b63b612ddd6acece7' (85733a1)