Home › Developer Tools

Regex Tester

Patterns that take longer than 1 second are stopped automatically, so your browser never freezes.

Files are processed in your browser and never uploaded

Try a regex instantly

Regular expressions describe text patterns like “3 digits, dash, 3 digits, dash, 4 digits”. They're everywhere — code, data cleanup, spreadsheet REGEX functions, find-and-replace in editors — and one wrong character changes everything. This tool highlights matches as you type and lists positions and capture-group values in a table, so you can see at once whether the pattern does what you mean.

Flags

Replace and common patterns

Type a replacement to preview the result. $1, $2 refer to the first and second capture groups and $& to the whole match — for example, $1-***-$3 masks the middle of a phone number. Ready-made patterns for phone numbers, email, URLs, dates, ZIP codes, letters in any language, HTML tags and IP addresses can be tried from the list. They're meant for finding common formats, not for strict validation of every edge case.

This uses your browser's JavaScript regex engine. Most syntax matches Python, Java and spreadsheet regex, but some features (lookbehind, named-group syntax) can differ. Runaway patterns are stopped after 1 second so the page never hangs. Your text never leaves your device.

Frequently asked questions

Does \d match digits in other scripts?

In JavaScript, \d matches only 0–9. Use \p{Nd} with the u flag for all decimal digits.

How do I match any letter, including accented ones?

Use \p{L} with the u flag (the “Letters only” preset).

Can I use these in Excel or Google Sheets?

Mostly yes — in REGEXTEST/REGEXEXTRACT (Excel 365) or REGEXMATCH (Sheets), though a few features differ.

Related tools