hangul-lube
TypeScript icon, indicating that this package has built-in type declarations

1.4.1 • Public • Published

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

import { pattern } from "hangul-lube"

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

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

Package Sidebar

Install

npm i hangul-lube

Weekly Downloads

4

Version

1.4.1

License

MIT

Unpacked Size

12.1 kB

Total Files

21

Last publish

Collaborators

  • artxe2