Regex Tester
Test regular expressions with live match highlighting
Accepted upload: .txt · max 5 MB. Matching runs locally in your browser.
Pattern
JavaScript-style regular expression (without surrounding slashes)
Test text
Matches update as you type
Highlighted matches
Fix the pattern to see highlights
Add test text to highlight matches.
Match details
Capture groups and index ranges for each match
About this regex tester
Test JavaScript regular expressions against sample text. Enter a pattern without slashes, choose flags g, i, m, s, u, and y, and see highlighted matches with details. Pattern length is capped at 2,000 characters; test text at 200,000; matches stop at 1,000 for performance. Copy the regex or match list.
How to use
- Type the pattern in the regex field (no leading/trailing slashes).
- Toggle flags: global, ignore case, multiline, dotAll, unicode, sticky.
- Paste or type test text in the text area.
- Review highlights and the match detail list; copy regex or matches when ready.
JavaScript RegExp behavior
This tester uses the same RegExp engine as modern JavaScript in your browser. Features like lookbehind or named groups depend on browser support. Invalid patterns show a syntax error instead of matching silently.
- Global flag finds multiple matches; without it, only the first match is reported.
- The match cap prevents runaway backtracking from freezing the tab on huge inputs.
Common uses
- Prototype validation rules before adding them to code.
- Explain why a pattern fails on edge-case strings.
- Compare flag combinations on multiline logs.
Tips
- Escape backslashes in the pattern field the way you would in a JS string literal.
- If results stop at 1,000 matches, narrow the pattern or disable global for a single check.
- Remember other languages (Python, Go) differ—confirm in target runtime before shipping.
Privacy
Patterns and sample text stay local. Nothing is uploaded for matching or logging.
Limitations
- JavaScript only—not PCRE, .NET, or Ruby syntax.
- Pattern 2k chars, text 200k chars, max 1,000 reported matches.
- Catastrophic backtracking may still slow the tab before limits apply—simplify risky patterns.
Frequently asked questions
Common questions about the Regex Tester.
How does the Regex Tester work?
Enter a JavaScript regular expression pattern (without surrounding slashes), choose flags, and paste test text. Matches highlight in the sample and appear in Match details with indices and capture groups. You can copy the pattern or the match list.
Does my pattern or text leave my device?
No. Matching runs in your browser with the JavaScript RegExp engine. ToolsArk does not upload your pattern or test text.
Which flags are supported?
g (global), i (ignore case), m (multiline), s (dotAll), u (Unicode), and y (sticky). Toggle only the flags your pattern needs.
Why are matches capped?
To keep the page responsive, ToolsArk limits how many matches it lists (around 1,000). If your pattern matches more often than that, refine the pattern or shorten the sample text.
What are the size limits?
Patterns are limited to about 2,000 characters. Test text is capped at about 200,000 characters whether you paste or upload. You can choose a .txt file up to 5 MB, but uploads larger than the character cap are rejected—use a shorter sample for regex testing.
Tags
Continue with these utilities
People frequently use these utilities together.