RegExr
Tool · Free
An interactive environment for testing and learning JavaScript and PHP/PCRE regular expressions. Shows matches, groups, and explanations, and lets you assemble test cases.

What you can use for free
Checks, reference material, and testing are free in the browser; login is required to save your own patterns/favorites.
Access and limitations
Checks, reference material, and testing are free in the browser; login is required to save your own patterns/favorites. Source code is GPL-3.0; consider public visibility when saving and publishing examples.
Use cases
- Test an expression for search or validation
- Investigate a regex error with Codex using a specific example
Example workflow
A possible workflow; this is not a report of hands-on testing.
Example workflow with RegExr: Test an expression for search or validation.
Before you start
- A regular expression and examples that should and should not match.
- The target engine: JavaScript or PHP/PCRE, and the flags in use.
Steps
- Test the expression on a short known string and inspect capture groups.
- Add negative examples, an empty string, long input, and the required characters.
- Move the expression into the target code and repeat the same sample set.
Check your result
- Exactly the expected segments match; flags and engine have not changed the meaning.
- Check edge cases in the real project, not only in the expression editor.
Choosing RegExr
Test an expression for search or validation
Choose this when
- Test an expression for search or validation
- Investigate a regex error with Codex using a specific example
Requirements
- Before testing, choose JavaScript or PHP/PCRE according to the target code.
Things to consider
- Access terms: Checks, reference material, and testing are free in the browser; login is required to save your own patterns/favorites. Source code is GPL-3.0; consider public visibility when saving and publishing examples.
- Terms of use: GPL-3.0 for RegExr source code.
- Compatibility between engines cannot be inferred from one successful example.
Frequently asked questions
What can you use for free in RegExr?
Checks, reference material, and testing are free in the browser; login is required to save your own patterns/favorites.
What are the access terms for RegExr?
Checks, reference material, and testing are free in the browser; login is required to save your own patterns/favorites. Source code is GPL-3.0; consider public visibility when saving and publishing examples.
What terms of use matter for RegExr?
GPL-3.0 for RegExr source code.
Which environment can you use RegExr in?
Tech stack: JavaScript.
How do you get started with RegExr?
Test the expression on a short known string and inspect capture groups. Add negative examples, an empty string, long input, and the required characters. Move the expression into the target code and repeat the same sample set.
Why must an expression be tested in the selected engine?
RegExr supports JavaScript and PHP/PCRE. Choose the target application's engine, then check matches, groups, and negative examples. A successful check in one engine alone does not guarantee the same result in another.
Tech stack
- JavaScript
License
GPL-3.0 for RegExr source code.
GPL 3.0 — open-source code with copyleft
You can run, modify, and sell the program. When distributing a GPL program or a derivative product based on it, recipients must receive the corresponding source code and GPL rights; GPL-covered code cannot be made closed-source. Ordinary use of a tool does not make your project or the independent outputs it creates subject to GPL.
License termsTechnologies and topics
- Regular expressions
- JavaScript
- PCRE