Regex Tester Online — Test & Debug Regular Expressions Free
Write a pattern, paste your test string, see matches highlighted in real time. JavaScript regex engine, no install.
Expression Settings
How to test a regex online
Type your pattern into the Pattern field, pick your flags, paste some test text, and hit Run. Matches highlight inline and the table below breaks out each one with its captured groups. The Quick Patterns dropdown gives you ready-made patterns for email, phone, URL, IP address, and dates if you just need something standard.
What the flags actually do
g— find all matches, not just the first onei— case-insensitive:Hellomatcheshello,HELLO, etc.m— multiline:^and$match the start/end of each line, not just the whole strings— dotAll: makes.match newlines too (it skips them by default)u— full Unicode support: necessary for emoji and non-Latin characters
Regex quick reference — tokens you'll use most
| Token | Matches | Example |
|---|---|---|
| \d | Any digit 0—9 | \d+ → matches 42, 100 |
| \w | Letter, digit, or underscore | \w+ → matches hello_world |
| \s | Whitespace (space, tab, newline) | \s+ → splits on spaces |
| . | Any character except newline | h.t → hat, hit, hot |
| ^ | Start of string (or line with m flag) | ^Hello → only at line start |
| $ | End of string (or line with m flag) | world$ → only at line end |
| (abc) | Capturing group | (\d{4}) → captures year |
| (?:abc) | Non-capturing group | (?:https?):// |
One thing to watch out for: catastrophic backtracking
If your regex uses nested quantifiers like (a+)+ and the input doesn't match, the engine tries every combination before giving up. On short strings it's fine — on long strings or user-supplied input it can hang the thread for seconds or longer. Test your patterns here with realistic data lengths before putting them in production.
Complete Developer Toolkit
Regex is one of the most cross-cutting tools in a developer's workflow — it's used in data validation, string parsing, log analysis, and code search. Once you've built and tested your pattern, use our JSON formatter to validate the JSON data you're parsing with regex, and our SQL formatter to clean up the database queries where your regex patterns might be used in REGEXP clauses. Our diff checker is useful when comparing the output of regex transformations — paste before and after text to confirm your substitution worked correctly.
For encoding the matched strings you extract, our URL encoder handles percent-encoding of extracted URL components, and our Base64 encoder converts matched binary or credential strings for transport. The HTML entity encoder sanitizes matched text for safe HTML insertion. Our JS minifier is closely related since minifiers use regex internally to strip whitespace and comments. The Python cheat sheet and JavaScript array methods reference both cover the regex methods available in each language — useful for translating a working browser regex into production code.
How to Use This Tool
- 1 Enter your regex pattern — no slashes needed, just the pattern itself.
- 2 Check the flags you want: g for all matches, i to ignore case, m for multiline.
- 3 Paste your test string below.
- 4 Hit Run Test — matches highlight and groups appear in the table.