Regex Tester
Test and debug regular expressions with live highlights.
Type a pattern and some test text. Matches are highlighted instantly with named and numbered capture groups listed below.
8 matches
- #1 @ 0Testgroups: ["Test"]
- #2 @ 5arnaudgroups: ["arnaud"]
- #3 @ 12appgroups: ["app"]
- #4 @ 17freegroups: ["free"]
- #5 @ 23fastgroups: ["fast"]
- #6 @ 29privategroups: ["private"]
- #7 @ 37onlinegroups: ["online"]
- #8 @ 44toolsgroups: ["tools"]
How to use it
Type a pattern
Drop your regex into the pattern field. You can include named capture groups like `(?<word>\w+)`.
Set flags
g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), y (sticky). Default is `gi`.
Paste test text
Drop sample text. Matches highlight inline and group contents list below.
What is it?
A regex (regular expression) is a compact pattern language for matching text. A regex tester compiles your pattern, runs it against a test string, and shows every match - including which substrings each numbered or named capture group matched. Live highlighting makes it possible to iterate on a tricky pattern without round-tripping through your code editor and a debugger.
When to use it
Whenever you're writing a non-trivial regex: extracting fields from log lines, validating user input, building search-and-replace rules, parsing CSV cells, scraping HTML attributes, or migrating data between schemas. It's also the fastest way to test someone else's regex when you inherit a codebase or copy a snippet from Stack Overflow.
Common mistakes
Forgetting the `g` flag - without it, exec returns only the first match. Greedy quantifiers (`.*`) that swallow too much; use `.*?` for non-greedy. Anchors (`^` and `$`) behaving differently with the `m` flag. And the biggest one: trying to parse HTML or JSON with regex - use a real parser instead, regex can't handle nested structures.
FAQ
- Which regex flavour does this support?
- JavaScript regex (ECMAScript). If you need PCRE or Python regex, the syntax is very similar but lookbehinds and Unicode property escapes behave slightly differently.
Related tools
More in this category
- JSON Formatter & Validator
- Base64 Encoder / Decoder
- URL Encoder / Decoder
- Hash Generator (SHA-1, SHA-256, SHA-384, SHA-512)
- JWT Decoder
- Markdown to HTML Converter
- YAML to JSON Converter
- CSV to JSON Converter
- SQL Formatter
- HTML Entity Encoder / Decoder
- Cron Expression Reader
- XML Formatter
- HTML Minifier
- Mock Data Generator
- Markdown Table Generator