What is regex tester?
Regular expressions describe patterns in text, such as emails, dates or IDs. They are powerful and easy to get wrong, so testing against sample text saves time.
This tester uses the JavaScript regex engine in your browser. It shows each match, where it starts and what each capture group caught.
How to use the regex tester
- Type the pattern without slashes.
- Add flags such as g for all matches, i to ignore case and m for multiline.
- Paste your test text and read the matches.
How the regex tester works
The tool builds a RegExp object from your pattern and flags and runs it across the text, collecting up to 200 matches.
Worked example
Common uses of the regex tester
- Building a pattern to validate emails, dates or IDs.
- Finding and replacing text in an editor with a safe pattern.
- Extracting data from logs and exports.
- Learning regular expression syntax with instant feedback.
- Debugging why a pattern matches too much or too little.
Tips and common mistakes
Start simple and build up. Add one part of the pattern at a time.
Use anchors and word boundaries to avoid matching more than you intend.
Background: what to know before you rely on it
Regular expressions were invented by mathematician Stephen Kleene in the 1950s and entered programming through Unix tools in the 1970s. They are compact but can be cryptic. Greedy patterns match as much as possible, so adding a question mark makes them lazy. Anchors such as caret and dollar fix a match to the start or end of a line. Capture groups pull out parts of a match. A badly written pattern can take exponential time on some inputs, a problem called catastrophic backtracking, so test with long strings. For complex formats such as HTML or full email rules, a proper parser is often a better tool.
Private, free and fast
This tool runs entirely in your browser. What you type or choose is not uploaded to a server and is not saved after you close the page, which keeps it fast and private. It is free to use as often as you like. See more in all developer tools, or browse the full list of tools.
Frequently asked questions
What do the flags mean?
g is global, i ignores case, m is multiline, s lets the dot match new lines and u enables Unicode.
Why does my pattern not match?
Check escaping. Backslashes need care in JavaScript strings but not in this box.
Does it support PCRE or Python?
No. It uses the JavaScript engine.
Related tools
JSON Formatter and Validator
Paste your JSON and the tool checks that it is valid, then formats it with indentation or compresses it...
Developer ToolsBase64 Encoder and Decoder
Base64 turns text or bytes into a safe string of letters and numbers. Choose encode or decode, paste...
Developer ToolsURL Encoder and Decoder
URL encoding replaces unsafe characters with a percent sign and two hex digits so a link works...
Developer ToolsHash Generator
A hash is a fixed length fingerprint of your text. Enter text to get its SHA 1, SHA 256, SHA 384 and SHA...
SEO ToolsMeta Tag Generator
Enter your page title, description and URL and the generator writes the HTML meta tags, including Open...
GeneratorsLorem Ipsum Generator
Choose how many paragraphs, sentences or words you need and the generator returns placeholder text you...
Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Do not paste live secrets into any website.