동작 원리
Matching is driven by JavaScript's own regular expression engine, the one that will run your pattern in a browser or in Node, so the result you see is the result you will get. That matters because engines differ in ways that are easy to miss: lookbehind is supported in JavaScript and in PCRE but not in Go's RE2, and possessive quantifiers and atomic groups are PCRE-only. If your production code runs on a different engine, testing here tells you about the pattern's logic but not about its portability.
Flags change the meaning of a pattern more than most people expect. The g flag finds every match rather than stopping at the first, and its absence is why a replace call so often changes only one occurrence. The i flag makes matching case-insensitive, m makes ^ and $ match at line boundaries instead of only at the start and end of the whole string, s makes the dot match newlines, and u enables full Unicode mode where a character class understands code points rather than UTF-16 units — which is the difference between matching an emoji correctly and matching half of it.
Capture groups are numbered by the order of their opening parentheses, and nested groups are numbered by where they open, not where they close. A group followed by a quantifier captures only its final iteration, which is the classic reason a pattern that looks like it should capture a list returns one item. Named groups with the (?<name>...) syntax avoid the counting problem entirely and this tool lists them by name alongside their positions, so the relationship between the pattern and the extracted values is visible rather than inferred.
Two failure modes deserve explicit warning. A pattern with nested quantifiers such as (a+)+b can take exponential time on a non-matching input, which is catastrophic backtracking and a genuine denial-of-service vector when the pattern runs against user input — a 30-character string can hang a process. The other is the unanchored pattern: \d{4} will happily match the first four digits of a longer number, and adding ^ and $ is usually what was intended. Both are reported rather than left for you to discover.
주요 활용 사례
- Build and debug a validation pattern for an email address, URL, phone number or semantic version.
- Extract fields from log lines by writing a pattern against real samples rather than guessing.
- Check which capture group a value landed in before writing the code that reads it.
- Preview a replace operation with backreferences to confirm the output format before applying it to a file.
- Test whether a pattern is catastrophically backtracking before shipping it to a server.
- Convert an unreadable pattern into a plain-language explanation for a code review or a comment.
최종 수정: 2026-10-14 — 본문은 영어로 표시되며 UI는 번역되었습니다.