Page last updated
How to use it
- Type your pattern between the slashes and choose the flags: g for every match, i to ignore case, m for line starts, s so the dot matches line breaks, u for Unicode.
- Paste the text to test. Matches are highlighted as you type, and listed with their position and groups.
- Open Explain to read the pattern part by part, or Replace to try a substitution such as $1 or $<name>.
- Add examples that should match and should not match in Tests to check the pattern as you change it.
- Open Code to copy the pattern for your language, and read the notes on what differs there.
How it calculates
The pattern runs on your browser’s own JavaScript regular expression engine, so results are exactly what JavaScript, TypeScript and Node.js give. The run happens in a background worker with a time limit, so a pattern that backtracks without end is stopped and cannot freeze the page. Matches are listed with their position and capture groups, using the d flag for exact group positions. The explanation is read from the pattern text itself. The notes on Python, Java, C#, PHP and Go come from those languages’ documentation and are never run.
For example, the pattern (\d{3})-(\d{3})-(\d{4}) with the g flag finds 2 matches in “Call 415-555-0132 or 415-555-0188 today.”: 415-555-0132 at position 5 and 415-555-0188 at position 21. Each match has three groups, the first being 415. Replacing with ($1) $2-$3 gives “Call (415) 555-0132 or (415) 555-0188 today.”. The explanation reads the pattern as 14 parts, starting with “start of capture group 1”. The text is made up; yours comes from what you type.
Who should use it
- Developers writing or debugging a regular expression for JavaScript, TypeScript or Node.js
- Anyone using Python, Java, C#, PHP or Go who wants a quick way to try a pattern and see where those languages differ
- Learners who want each part of a pattern explained
- People cleaning text with find and replace in an editor that supports regex
Who should not use this
- Anyone who needs the exact behaviour of another engine: this runs JavaScript, and the notes on Python, Java, PCRE and Go are guidance, not a test run
- Anyone validating security-critical input such as email addresses, passwords or HTML; a pattern is not enough for these, and the examples say so
- Anyone testing text that is secret and must not be pasted into a web page; nothing is uploaded, but treat sensitive data with care on any shared computer
Limitations
- Only the JavaScript engine is run. Python’s re, Java, .NET, PCRE (PHP) and Go (RE2) have differences in syntax and behaviour that the notes point out but do not test.
- Text is limited to 200,000 characters and the match list to 2,000 matches, to keep the page responsive.
- A pattern that takes more than about two seconds is stopped and reported. A pattern that is slow on some other text may still take long in your own program.
- The plain-English explanation covers standard syntax. Unusual constructs are shown as they are, with a note that they are not explained.
- The built-in examples find text of a certain shape. For example, the email pattern cannot tell if an address exists, and the date pattern allows 31 February.
- Nothing is uploaded or stored on a server. Clearing your browser data also removes the saved profile.
Sources and review
Reviewed on 20 Oct 2026 against the published sources below. Rules and prices change, so check the current position before you rely on a figure.
- MDN Web Docs: Regular expressions (JavaScript syntax, flags, groups and lookarounds)
- MDN Web Docs: RegExp reference (flags, named groups, the d flag for match indices)
- ECMAScript language specification: regular expression objects
Common questions
What is a regex tester?
Which regex engine does this use?
How do I test a regex with capture groups?
Why do I get “nothing to repeat” or “unterminated group”?
What is catastrophic backtracking?
What do the flags g, i, m, s, u and y do?
How do I write a regex for an email address, phone number or ZIP code?
Will my pattern work in Python, Java or PHP?
Is my text sent anywhere?
Guides that explain the rules
Related tools
This tool produces a document from the information you type. It does not give legal, tax or accounting advice, and it does not check that your figures or rates are right. See the disclaimer. Found a mistake? Report an error in a calculation.