Skip to main content
Ink·tab

Patterns · options · live match preview

Check a pattern live and load common ones with a single click.

Pattern
//g
0 matches
Flags
Common patterns
Match preview
연락처 010-1234-5678, 회사 02-555-0101
이메일 dev@example.com · 문의 support@util-platform.dev
참고 https://util-platform.dev/tools
ID user_12345 · alice99
IPv4 192.168.0.1 (내부망)
색상 #3a4bd0 · #fff · #ff6b35
Everything happens in your browser. Nothing is uploaded.

When to use it

To check whether strings like phone numbers and emails match a rule, or to pull specific fragments out of a long text. Matches update as you edit the pattern.

How it works

Type the pattern in the top input, then toggle g · i · m · s · u · y as flags. The right pane highlights matches. The pill row below offers common patterns (phone, email, IPv4, etc.) — click one and tweak from there.

Eight Korean-input patterns (preset library)

The "common patterns" library bundles eight ready-to-apply patterns. All are JavaScript ES2018+.

  • Mobile phone/^(01[016789])-?(\\d{3,4})-?(\\d{4})$/ Starts with 010·011·016·017·018·019, followed by 3–4 digits and 4 digits. Hyphens optional. Three capture groups normalize to 010-1234-5678 form.
  • Resident registration number (RRN)/^\\d{6}-?[1-4]\\d{6}$/ Six-digit birthdate + optional hyphen + gender/century digit (1–4) + six digits. Final check-digit validation is a separate algorithm. Important: mask immediately on input — Korean PIPA Article 23 treats RRNs as sensitive.
  • 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.
  • 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 for AdSense applications, tax invoices.
  • Hangul-only/^[가-힣]+$/ Allows precomposed Hangul syllables (U+AC00–U+D7A3) only. Rejects decomposed Jamo (ㄱ + ㅏ). Caveat — rejects Hanja and mixed names like "Lee 영희" — verify the UX requirement first.
  • Email/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/ Practical simplification of RFC 5322. Catches 99% of real emails but misses IDNs (Hangul domains). For stricter checks, send a verification link.
  • URL (http/https)/^https?:\\/\\/[\\w.-]+(?::\\d+)?(?:\\/[^\\s]*)?$/ Protocol + host + optional port + optional path. Rejects ftp, file, etc.
  • IPv4 — Each octet bounded to 0–255. 192.168.0.1 ✓, 256.0.0.1 ✗.

Common pitfalls

  • Hangul doesn't match\\w excludes Hangul. Use [가-힣], or the u flag with Unicode properties (\\p{L}).
  • Special characters. ? + * ( ) [ ] { } | \\ must be escaped with \\ to match literally.
  • Greedy matching.* grabs as much as it can. Use .*? for the minimal match.
  • Too slow — Patterns like (a+)+ can explode (ReDoS). Anything over 500ms is cancelled automatically with a notice.
  • Input over 100KB — Blocked to protect browser performance. Slice a sample first.

Pattern runs in a Worker with a 500ms guard

ReDoS-vulnerable patterns are auto-aborted via a Web Worker + 500ms timeout. Input capped at 100KB. Pattern and target both stay in the page.

Frequently asked questions

Why doesn't my regex match Korean characters?
`\w` only matches ASCII letters, digits, and underscore. To match Hangul, use `[가-힣]` for syllables, or the `u` flag with `\p{L}` for any letter. The "Hangul" preset loads this pattern in one click.
What does the 'g' flag do?
Global flag. Without it, the regex stops at the first match. With it, every match in the input is found. Usually on by default for testing.
Why is my pattern reported as too slow?
ReDoS risk — patterns like `(a+)+` or `(a|aa)+` have nested quantifiers that explode exponentially with input length. The tool aborts patterns that take more than 500ms to protect your browser. Tighten the pattern (often `a+` alone is enough).
Can I test multi-line strings?
Yes. The `m` (multiline) flag makes `^` and `$` match line starts/ends. The `s` (dotall) flag makes `.` match newlines.
How do I escape special characters?
`. ? + * ( ) [ ] '{ }' | \` are regex metacharacters; precede them with `\` to match them literally (e.g., `\.` for a period). Most lose their special meaning inside `[ ]` character classes.