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

만드는건 어려운데 사용하면 좋은 정규식(Sample) #15

Open
SeonHyungJo opened this issue Jun 10, 2019 · 0 comments
Open
Labels
💌 JavaScript 공부를 해도해도 어려운 JavaScript :shipit: Tip 내가 사용해보니 좋은 팁 👍 type:AWOT AWOT(a waste of time) == 삽질

Comments

@SeonHyungJo
Copy link
Owner

SeonHyungJo commented Jun 10, 2019

정규식이 잘 사용하면 정말정말 끝도없이 편하지만 진입장벽이 생각보다 존재한다. 이번 기회에 공부를 해보자

규칙 구현 설명
모든 공백 찾기 /\s/g 띄어쓰기, 탭, 줄바꿈 감지
휴대전화번호 01[016789]\D?\d{3,4}\D?\d{4} 010-1234-5678, 01012345678, 010.1234.5678
이메일 체크 /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$ seonhyung.jo@gmail.com
URL https?://(\w*:\w*@)?[-\w.]+(:\d+)?(/([\w/_.]*(\?\S+)?)?)? https://regexr.com/
// /**/주석 찾기 \/\/.* // 주석을 찾자
마스터 카드 5[1-5]\d{14} MasterCard: 5212345678901234
비자 카드 4\d{12}(\d{3})? Visa 1:4123456789012

Reference

@SeonHyungJo SeonHyungJo added 💌 JavaScript 공부를 해도해도 어려운 JavaScript 👍 type:AWOT AWOT(a waste of time) == 삽질 :shipit: Tip 내가 사용해보니 좋은 팁 labels Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💌 JavaScript 공부를 해도해도 어려운 JavaScript :shipit: Tip 내가 사용해보니 좋은 팁 👍 type:AWOT AWOT(a waste of time) == 삽질
Projects
None yet
Development

No branches or pull requests

1 participant