Why Korean inputs need their own patterns
Hangul lives in two Unicode regions: precomposed syllables (U+AC00–U+D7A3) and Jamo components (U+1100+). ASCII-based regex like [a-zA-Z]+ won't catch any of it. Korean-specific identifiers (mobile 010, 13-digit RRN, 10-digit business number) also follow their own rules. This guide covers eight common patterns — all JavaScript ES2018+ (with u flag for Unicode).
Try every pattern in the regex tester — all eight are pre-loaded in the "common patterns" library; one click applies them.
1. Mobile phone number
/^(01[016789])-?(\d{3,4})-?(\d{4})$/Starts with 010, 011, 016, 017, 018, or 019, followed by 3–4 digits and 4 digits. Hyphen is optional. Three capture groups make normalization trivial (e.g. emit everything as 010-1234-5678).
2. Resident registration number (RRN)
/^\d{6}-?[1-4]\d{6}$/Six-digit birthdate · optional hyphen · gender/century digit (1–4) · six digits. Verifying the final check digit requires a separate algorithm. Important: mask immediately on input — Korean PIPA Article 23 considers RRNs sensitive personal data.
3. Postal code (5 digits)
/^\d{5}$/Korea moved to 5-digit codes in 2015. The older 6-digit format (123-456) is no longer in use. Restrict input to exactly 5 digits.
4. Business registration number
/^\d{3}-?\d{2}-?\d{5}$/3 + 2 + 5 digits, 10 total. Hyphen optional. Check-digit verification is a separate algorithm. Required when applying for AdSense or invoicing.
5. Hangul-only
/^[가-힣]+$/Allows precomposed Hangul syllables only. Decomposed Jamo (ㄱ + ㅏ) is rejected. Useful for restricting name inputs to Korean.Caveat: rejects Hanja (occasional Chinese characters in Korean) and mixed names like "Lee 영희" — verify the UX requirement first.
6. Email
/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/Practical simplification. The full RFC 5322 pattern is hundreds of lines long. The above catches 99% of real emails but misses IDNs (Hangul domains). For stricter checks, send a verification link.
7. URL (http/https)
/^https?:\/\/[\w.-]+(?::\d+)?(?:\/[^\s]*)?$/Protocol (http or https) + host + optional port + optional path. Rejects ftp, file, and other protocols. Sufficient for most web input fields.
8. IPv4
/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/Each octet is bounded to 0–255 via 25[0-5] | 2[0-4]\d | [01]?\d\d?. Accepts192.168.0.1 ✓, rejects 256.0.0.1 ✗.
Try it now
All eight patterns are registered in the regex tester library. One click applies the pattern; paste your data and see matches instantly. Pattern input also accepts inline syntax like /foo/gi — the slashes and flags are split automatically.
Related tools
- Regex tester — try patterns
- Diff — compare match results between two patterns
- Text stats — measure input length
- Slugify — convert Hangul titles to URL slugs