Regex Tester & Explainer
Type a pattern and some text: matches are highlighted as you type, capture groups are listed, and every part of the pattern is explained in plain English. Everything runs in your browser.
//gm
3 matches
2026-10-28T09:15:02Z WARN payment-service timeout after 30s 2026-10-28T09:15:07Z INFO auth-service login ok 2026-10-28T09:16:44Z ERROR payment-service card declined
Capture groups
| # | Match | level | service |
|---|---|---|---|
| 1 | WARN payment-service | WARN | payment-service |
| 2 | INFO auth-service | INFO | auth-service |
| 3 | ERROR payment-service | ERROR | payment-service |
Explanation
(?<level>start of capturing group 1, named "level"INFOthe text "INFO"|OR: match either the part before or the part afterWARNthe text "WARN"|OR: match either the part before or the part afterERRORthe text "ERROR")end of groupthe character " "(?<service>start of capturing group 2, named "service"[\w-]one character: a word character (letter, digit or underscore) or "-"+repeat the previous item 1 or more times)end of group
How to use the regex tester
- Enter your pattern without the surrounding slashes, for example
\d{4}-\d{2}. - Toggle flags:
iignores case,mmakes^and$match at each line,slets.match newlines,uenables full Unicode. - Paste the text you want to search. All matches are found (the
gflag is always on). - Read the explanation to check that each part means what you intended.
Which regex flavor does this use?
The tester uses your browser's JavaScript regex engine, so results match what you get in JavaScript and TypeScript. Python, Java, Go and PCRE share the core syntax but differ in details such as lookbehind support and named-group syntax — Python, for example, also accepts (?P<name>...).
Tips
- Anchor validation patterns with
^and$so they match the whole string. - Escape literal dots:
example\.com. - Prefer specific classes like
[^"]*over.*to avoid matching too much.
Need ready-made patterns? See our Regex Cheat Sheet with real examples.