1.4.1 • Published 6 months ago

hangul-lube v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Hangul Lube

Simplify Korean Consonant Search in JavaScript

Working with Korean text and performing consonant-based searches can be complex and time-consuming.
With "hangul-Lube", a powerful JavaScript library, you can simplify the process of generating regular expression patterns for Korean consonant search.
This library allows you to effortlessly match Korean words or characters with the same initial consonant letter as the input text.

Installation

npm i hangul-lube
pnpm i hangul-lube
bun i hangul-lube

How to use

Get regular expression pattern for Korean consonant search

import { pattern } from "hangul-lube"

var p: string = pattern("ㄷㅎㅁㄱ")
//=> "[다-딯][하-힣][마-밓][가-깋]"

var p: string = pattern("특수문자 test 1234!@#$")
//=> "특[수-숳]문[자-잫] test 1234!@#$"

Get regular expression for flexible korean search.

import { searcher } from "hangul-lube"

var r: RegExp = searcher("ㄷㅎㅁㄱ")
//=> /[다-딯][^가-힣0-9A-Z]*?[하-힣][^가-힣0-9A-Z]*?[마-밓][^가-힣0-9A-Z]*?[가-깋]/i

var r: RegExp = searcher("특수문자 test 1234!@#$")
//=> /특[^가-힣0-9A-Z]*?[수-숳][^가-힣0-9A-Z]*?문[^가-힣0-9A-Z]*?[자-잫][^가-힣0-9A-Z]*? [^가-힣0-9A-Z]*?t[^가-힣0-9A-Z]*?e[^가-힣0-9A-Z]*?s[^가-힣0-9A-Z]*?t[^가-힣0-9A-Z]*? [^가-힣0-9A-Z]*?1[^가-힣0-9A-Z]*?2[^가-힣0-9A-Z]*?3[^가-힣0-9A-Z]*?4[^가-힣0-9A-Z]*?![^가-힣0-9A-Z]*?@[^가-힣0-9A-Z]*?#[^가-힣0-9A-Z]*?$/i
1.4.1

6 months ago

1.3.2

7 months ago

1.4.0

6 months ago

1.3.1

7 months ago

1.2.0

9 months ago

1.1.1

9 months ago

1.3.0

8 months ago

1.1.0

9 months ago

1.0.0

9 months ago

0.1.1

10 months ago

0.1.0

10 months ago