Thử regex
Thử regular expression với văn bản mẫu, xem nhóm bắt được, debug pattern và copy regex hoàn chỉnh ra code — không phải mở thêm tab.
Regex Tester evaluates a JavaScript regular expression against a string and shows every match, capture group, and start index in real time. It is useful for drafting validation patterns, debugging a search-and-replace, and understanding how flags such as global or multiline change a match.
/pattern/flags.The engine is the browser's native RegExp implementation, so features outside ECMAScript (recursion, possessive quantifiers, conditional groups) are not supported. Zero-width matches advance the cursor automatically to avoid infinite loops. Invalid patterns surface the engine's own error message in the alert bar.
It uses the JavaScript RegExp engine that runs in your browser, so syntax, escapes, and Unicode behavior follow ECMAScript rules. Patterns that depend on Perl or PCRE features such as recursion or possessive quantifiers will not work.
No. The pattern, flags, test string, match list, and highlighting are all computed locally with the browser's RegExp object. Nothing leaves your device.
An error usually means the pattern is invalid for the active flags (for example an unclosed group, an unsupported escape, or a missing /u flag for a Unicode property). Fix the pattern in the input and the matches and highlights re-render automatically.
Each match card shows the full match, its index, and any capture groups numbered $1, $2, and so on. Named groups still appear in their numeric position.