# 한글 초성 검색도 지원하는 퍼지 문자열 검색

> Clean Markdown view of GeekNews topic #3631. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=3631](https://news.hada.io/topic?id=3631)
- GeekNews Markdown: [https://news.hada.io/topic/3631.md](https://news.hada.io/topic/3631.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2021-01-25T09:31:30+09:00
- Updated: 2021-01-25T09:31:30+09:00
- Original source: [taegon.kim](https://taegon.kim/archives/9919)
- Points: 36
- Comments: 4

## Topic Body

"개떡같이 일부만 입력해도 찰떡같이 원하는 결과를 보여주는 UI"

- JavaScript + 정규식으로 대충 만들기

- 퍼지 문자열 매칭 : 정확히 일치하지는 않더라도 대충 비슷한 느낌의 문자열을 찾아주는 방법

- 영문 검색 + 한글 검색(초성) + 색상 강조 + 가중치 처리

## Comments



### Comment 4311

- Author: sftblw
- Created: 2021-01-25T10:41:14+09:00
- Points: 1

유니코드 정규화 중 분해 방법을 사용해서 한글 자모를 분리하고 시작하는 것도 방법이 아닐까 하고 생각해봤는데요, 이렇게 하면 원본 문자열에서의 인덱스를 찾는 게 어렵겠네요.

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/String/normalize#%ED%95%9C%EA%B8%80%EC%97%90_normalize_%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0

### Comment 4309

- Author: eyelove
- Created: 2021-01-25T10:37:27+09:00
- Points: 1

멋져요.... 나중에 써먹을래요..~!

### Comment 4308

- Author: zelord
- Created: 2021-01-25T09:55:30+09:00
- Points: 1

와.... 엄청 이해하기 쉽게 정리해주셨네요!!

글을 읽으면서 "이런 것도 있으면 좋지 않을까?" 했던 내용이 바로바로 아래에 나오는 걸 보니 너무 신기했습니다.

대단해요!!!

### Comment 4307

- Author: sagehoit
- Created: 2021-01-25T09:48:22+09:00
- Points: 1

와~ 멋있네요~!

결과도 멋있지만 점점 더 발전해 가는 부분이 더 멋있어요~
