Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: 문자열에서 한글만 파싱 #108

Open
youngjae99 opened this issue May 28, 2024 · 0 comments
Open

[Feature]: 문자열에서 한글만 파싱 #108

youngjae99 opened this issue May 28, 2024 · 0 comments

Comments

@youngjae99
Copy link
Contributor

Description

문자열에서 한글만 추출(parse)할 수 있으면 좋을 것 같습니다.

parseHangul('안녕하세요1234abc') // '안녕하세요'
parseHangul('abcde') // ''
parseHangul('안녕하세요ㄱㄴ') // '안녕하세요ㄱㄴ'
parseHangul('안녕하세요    만나서 반갑습니다') // '안녕하세요    만나서 반갑습니다'
parseHangul('가나다!-29~라마바.,,사') // '가나다라마바사' 

Possible Solution

const parseHangul = (str: string): string => str.replace(/[^ㄱ-ㅎ가-힣\s]/g, '');

etc.

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant