Type a pattern and some test text. Matches are highlighted live, every capture group is listed, and a replace box previews substitutions before you put the regex in your code.
Write to sales@pyalm.com or support+uae@example.co.ae today.
Type a replacement to preview it| # | Index | Match |
|---|---|---|
| 1 | 9 | sales@pyalm.com |
| 2 | 28 | support+uae@example.co.ae |
| . | Any character except newline |
| \d \w \s | Digit · word char · whitespace |
| \D \W \S | Not digit · not word · not space |
| [abc] [^abc] | Any of · none of |
| a* a+ a? | 0+ · 1+ · 0 or 1 |
| a{3} a{2,5} | Exactly 3 · between 2 and 5 |
| a+? | Lazy (as few as possible) |
| ^ $ | Start · end of line/string |
| \b | Word boundary |
| (abc) | Capture group |
| (?<name>abc) | Named group |
| (?:abc) | Non-capturing group |
| a|b | a or b |
| (?=a) (?!a) | Lookahead · negative lookahead |
| (?<=a) (?<!a) | Lookbehind · negative lookbehind |
Pyalm builds custom software, APIs and integrations for businesses in India and the UAE. We made these developer tools for our own team — use them free, and talk to us when you need something built.
Regular expressions are compact and easy to get subtly wrong. Highlighting every match in your sample text — with each capture group broken out underneath — shows immediately whether the pattern is too greedy, misses an edge case or matches across lines it shouldn't.
The tester uses your browser's own RegExp engine, so behaviour matches JavaScript and TypeScript exactly: g, i, m, s, u, y and d flags, lookbehind, named groups and Unicode property escapes all work as they will in production.
📖 Read the full guide: Regex Cheat Sheet with Real Examples (Emails, Phones, Dates, UAE TRN)
Format, validate, minify and syntax-highlight JSON — with exact error line and column.
Percent-encode or decode URLs and query strings, and break a URL into its parts.
Minify or beautify JavaScript, CSS, HTML and JSON — see the size you saved.
JavaScript (ECMAScript). Most syntax is shared with PCRE, Python and Java, but a few features differ — for example possessive quantifiers and atomic groups are not supported in JavaScript.
Without the g (global) flag a regex stops after the first match. Turn on g to find every match in the text.
Use $1, $2 … for numbered groups, $<name> for named groups, and $& for the whole match. Use $$ for a literal dollar sign.
Badly nested quantifiers like (a+)+ can backtrack catastrophically on some inputs. The tester caps the number of matches it shows, but if the page pauses, simplify the pattern — the same regex would be slow in production too.