Regex Tester
Test JavaScript regex with match highlighting, captures, replacement previews and positive or negative test cases. Browser-local execution includes timeout p...
To test a regex, type your pattern in Regular Expression and paste text in Test String; up to 500 matches are highlighted in the text and listed with its index and captured groups in the Matches table.
Last updated:
Regex Tester — Regular Expression Tester, Generator & Debugger Online. Test JavaScript regex with match highlighting, captures, replacement previews and positive or negative test cases. Browser-local execution includes timeout protection.
Test JavaScript patterns with our free online regex tester . See up to 500 non-empty matches, their indices, numbered captures and named groups.
Choose global ( g ), case-insensitive ( i ), multiline ( m ), dot-all ( s ), Unicode ( u ), Unicode Sets ( v ) or sticky ( y ) behavior. Preview replacement text, including capture substitutions, or run up to 20 positive and negative cases.
Each worker job has a two-second deadline. Optional samples and structure diagrams support a subset of syntax. Common regex use cases: Validating email addresses, phone numbers, postal codes, IP addresses, and passwords.
Extracting data from logs, HTML, CSV, and JSON strings. Finding and replacing text in code editors and scripts. Building URL routing patterns and route guards.
Our regex match checker shows you exactly which part of your text each pattern matches, and which groups capture what — eliminating the guesswork. All processing happens in your browser using JavaScript's built-in RegExp engine — test text stays in memory.
Patterns are retained in browser storage and the page URL; shared URLs expose the pattern. The site also loads ads. For a quick reference, see the built-in Regex Cheatsheet link on the tool page.
Frequently asked questions
How do I test a regular expression?
Type the pattern without surrounding slashes in the Regular Expression box and paste your text in Test String. The Matches card highlights up to 500 matches inside your text, alternating two colors for neighbouring matches, and its table lists each start index, matched text, numbered captures and named groups. Everything updates as you type.
How do I set regex flags like global or case-insensitive?
Choose g, i, m, s, u, v or y below the pattern. Unicode u/v are mutually exclusive; d is added for capture positions. The same flags apply to matching, replacement and test cases. Flags are retained in the URL, and links without flags use the original g/s/u defaults. Sticky y starts at index 0.
Why does it say No match found?
Check the flags: without Ignore Case letters must match exactly, and without Multiline the anchors ^ and $ match only the start and end of the whole text. Empty matches, such as a lone ^, are skipped while longer matches elsewhere in the text are still listed, and invalid patterns and execution timeouts have separate status messages. Jobs stop after two seconds; results are limited to 500 matches.
What are the Samples and the Regex Visual Diagram?
Choose Generate sample for a random example checked against the selected flags. Choose Draw diagram for a structure view of patterns up to 500 characters. Both helpers support a subset of syntax and may report that a result is unavailable. The diagram does not illustrate flag behavior.
Which regex engine does the tester use?
It uses your browser's built-in JavaScript RegExp engine, so supported syntax depends on your browser version. Other JavaScript runtimes may support a different set of features. Syntax from other flavors, such as PCRE possessive quantifiers or inline modifiers, may be rejected or behave differently.
Is my regex saved or shared?
The pattern is retained in browser storage and the URL; flags are in the URL. Personal test text, replacement text and cases stay in memory and are lost when leaving or reloading. Shared URLs expose their pattern and flags. Built-in examples may restore their public sample text by example ID. The site displays ads.
How do replacement previews work?
Enter replacement text and choose Preview replacement. JavaScript dollar tokens for matches and captures are supported; without g only the first occurrence changes. Blank replacement deletes matches. Previews stop at 500 replacements or a conservative one-million-character output budget; no partial output is returned. Zero-width matches count here even though the highlighting table omits them.
How do I test positive and negative cases?
Add up to 20 cases, check Should match for positives and uncheck it for negatives, then choose Run cases. Each case starts independently at index 0. Any match, including a zero-width match, counts; use anchors for whole-string requirements. The combined input limit is 200,000 characters, and the suite shares a two-second execution deadline.
How to use this online tool
Regex Tester — Regular Expression Tester, Generator & Debugger Online is designed for fast browser workflows when you need to format, validate, convert, decode, encode, generate, or inspect data without opening a heavy desktop app. Start with the input field or visible options, review the result, then copy or download the output for the next step.
Private processing in your browser
Regex Tester — Regular Expression Tester, Generator & Debugger Online keeps the normal processing step local in your browser. That is useful for code snippets, tokens, documents, configuration values, text samples, and other material that should not be sent to a remote service unless you explicitly choose to share it.
When this tool is useful
Use Regex Tester — Regular Expression Tester, Generator & Debugger Online for repeatable developer tasks, technical documentation, QA checks, quick conversions, debugging, content cleanup, and internal team workflows. The page focuses on clear inputs, immediate feedback, and output that is easy to reuse in code, reports, tickets, emails, or notes.
Practical tips
Before copying the final result, check important details such as spacing, casing, filenames, encoding, token structure, line breaks, or output format. Small checks prevent mistakes when the result is reused in source code, API requests, documentation, spreadsheets, or shared files.