Regex Tester
Test regular expressions and see live matches in real time.
Input
Output
What is Regex Tester?
Regex Tester applies your browser’s JavaScript regular-expression engine to the test text and lists complete matches, their start indices and numbered capture groups. Results update while you type, and Test regex repeats the check. It does not replace text, execute another language’s regex engine or prove that a pattern validates every possible input.
How to use Regex Tester
Enter \d+ as Regex pattern, leave Flags empty, and enter Order 12, batch 345 as Test text. Expect two matches: 12 at index 6 and 345 at index 16. Enter the raw pattern without slash delimiters such as /.../. This field is not a JavaScript string literal: use one backslash for \d, rather than doubling it for source-code string escaping.
When is Regex Tester useful?
Try ([A-Z]+)-(\d+) against ID-42. The complete match should be ID-42 at index 0, group 1 should be ID and group 2 should be 42. Flags such as i can change case matching. This tool always adds g if it is absent, so it searches for all matches even when Flags is empty; it does not offer a first-match-only mode.
Example
Try \d+ against no digits for “No matches found”. Enter [ as the pattern for a compilation error. Invalid or duplicate flags also produce an error rather than a list of matches. Start indices are zero-based UTF-16 positions, not necessarily visible character counts; an emoji before a match can occupy two positions.
Practical notes
Syntax and available flags depend on your browser and can differ from Python, Java, .NET or PCRE. Start with short text: matching runs on the page’s main thread without a timeout or cancel control, so expensive backtracking can block the tab. Test text is processed locally without sending it to an analysis API. See the JavaScript matchAll reference for match and capture behavior.