Regex Tester & Debugger
Free online regex tester. Test regular expressions in real time with match highlighting, capture groups, and flag toggles — all in your browser.
How to Use
- 1
Enter a regex pattern
Type your regular expression between the / delimiters. For example, (\w+)@(\w+\.\w+) to match email addresses.
- 2
Toggle flags
Click flag buttons to enable global (g), case-insensitive (i), multiline (m), or dotAll (s) modes.
- 3
Enter test text
Paste or type the text you want to test your regex against.
- 4
Review matches
Matches are highlighted in yellow. The details section shows each match, its position, and any captured groups.
What is Regex Tester & Debugger?
A regex tester is an online tool for writing, testing, and debugging regular expressions. You enter a pattern, paste sample text, and instantly see which substrings match, where each match starts and ends, and what each capture group extracts. This immediate feedback loop turns regex from an exercise in trial-and-error into a fast, visual workflow.
Regular expressions (regex) are a compact pattern-matching language built into virtually every programming language, text editor, and command-line tool. Developers use them for input validation (emails, phone numbers, URLs), search and replace, log parsing, data extraction, and input sanitization. The hard part is not writing a regex — it is verifying that it matches what you expect and rejects what you don't.
This regex tester uses JavaScript's native `RegExp` engine and supports all the flags you need for everyday use: global matching (`g`), case-insensitive (`i`), multiline (`m`), and dotAll (`s`). Matches are highlighted as you type. Capture groups are extracted with their positions. Common errors (unescaped special characters, missing flags) are easy to diagnose. Everything runs client-side — your patterns and test data never leave your browser.
For a quick syntax reference while you build patterns, open our [Regex Cheat Sheet](/cheat-sheets/regex/). For a step-by-step tutorial with annotated examples, see the guide on [Regular Expressions Cheat Sheet with Examples](/blog/regex-cheat-sheet-with-examples/). Related text-processing tools include the [Slug Generator](/tools/slug-generator/), [Diff Checker](/tools/diff-checker/), and [Line Sorter](/tools/line-sorter/).
FAQ
Which regex engine does this use?
Why doesn't my regex match anything?
What do the capture group numbers mean?
Is this compatible with Python/Java/PHP regex?
How do I test a regex against multiple lines?
Can I share or save my regex patterns?
Related Articles
Related Tools
URL Slug Generator
Convert any text into a clean, URL-friendly slug. Remove special characters, accents, and spaces automatically.
Diff Checker — Text Compare
Compare two texts side-by-side and see the differences highlighted. Find added, removed, and unchanged lines instantly.
Line Sorter
Sort lines alphabetically, by length, naturally, or randomly. Remove duplicates and trim whitespace. Supports ascending, descending, and custom sort modes.
JSON Validator
Validate your JSON data instantly. Check for syntax errors, see detailed error messages, and get document statistics.
JSON Tree Viewer
Visualize JSON data as an interactive, collapsible tree. Explore nested objects and arrays with ease.