Regex Tester
Processed in your browserTest JavaScript regular expressions with live match highlighting, capture groups, and flags.
What this tool does
Test JavaScript regular expressions with live match highlighting, capture groups, and flags.
Features
- Match highlighting
- Capture and named groups
- Flag toggles
- Match count
- Backtracking timeout
How to test a regular expression
- Enter a pattern without slashes, for example \d{3}-\d{4}.
- Toggle flags such as Global (g) or Ignore case (i).
- Paste test text and click Test regex.
- Review highlighted matches and the capture-group table.
Example: find phone numbers
- Input
- Pattern \d{3}-\d{4} with flag g Text: Call 555-0142 or 555-0199
- Result
- 2 matches: 555-0142, 555-0199
Common uses
- Build validation patterns for forms (emails, phone numbers, postcodes).
- Extract values from logs before writing a script.
- Debug search-and-replace patterns for your editor.
Supported formats
- JavaScript (ECMAScript) regex syntax
Limits
- 100,000 characters of test text
- First 1,000 matches
Limitations
- PCRE-only features (possessive quantifiers, recursion) are not available.
- Patterns that run longer than 2 seconds are stopped.
Privacy
Matching runs in a background worker in your browser; text is not uploaded.
Frequently asked questions
Related guides
- How to Test a Regex Online (JavaScript Regex Tester Guide)
How to test regex online: enter a JavaScript pattern, toggle g, i, m, s, and u flags, read matches and capture groups, and fix greedy matching and catastrophic backtracking.
- Free Developer Tools Online: JSON, JWT, Base64, URL, Timestamp & Regex
Free developer tools online that run in your browser: format JSON, decode JWTs, encode Base64 and URLs, convert Unix timestamps, and test JavaScript regex.
You may also need
JSON Formatter & Validator
Format, validate, and minify JSON. Tree view with syntax error highlighting.
URL Encoder / Decoder
Encode or decode URLs and query components with encodeURI or encodeURIComponent.
Case & Slug Converter
Convert text to Title Case, sentence case, camelCase, snake_case, kebab-case, or a clean URL slug.
Unix Timestamp Converter
Convert Unix timestamps to readable dates and dates back to epoch seconds or milliseconds.
Browse the free developer toolkit for every related tool and guide.