RegExr is a free, open-source online tool for building, testing, and learning regular expressions, built with HTML and JavaScript and hosted at regexr.com. It was created by Grant Skinner and the gskinner.com team, and its source code is available on GitHub under the GPL v3 license.
What is RegExr?
RegExr is an interactive web app that takes a regular expression pattern and a test string as input and shows matches in real time. It supports both JavaScript and PHP/PCRE regex flavors, making it useful for validating patterns across different engines. The tool also provides a reference library and community-shared patterns.
Key Features
- Real-time matching — Results update instantly as you type both the pattern and the test string.
- Two regex engines — Switch between JavaScript and PHP/PCRE syntax to see how each engine interprets the same pattern.
- Roll-over explanations — Hover over locations in the expression to see detailed breakdowns of what each token does.
- Save and share — Save expressions to get a shareable URL to collaborate with others.
- Exploration tools — Use the Tools menu to analyze matches, test replacements, and understand how the expression behaves.
- Reference library — Browse a built-in reference for regex syntax with examples.
- Community patterns — Search and rate patterns submitted by other users.
- Undo and redo — Editor supports cmd-Z and cmd-Y (or ctrl-Z/ctrl-Y) for quick iteration.
Who is it for?
- Web developers — Test JavaScript or PHP regex patterns against realistic sample data before writing production code.
- Data professionals — Validate data extraction patterns for cleaning or parsing text streams.
- Students and educators — Learn regex fundamentals by experimenting and reading the built-in explanations.
Use cases
- Front-end developers: Validate email formats, URLs, or phone numbers with JavaScript regex and immediately see edge cases.
- Back-end developers: Verify PCRE patterns for PHP functions like preg_match and preg_replace.
- Writers and editors: Craft complex find-and-replace expressions to clean up inconsistent text formatting.
How does RegExr work?
Type a pattern into the top field and paste a test string below; the results pane updates live. Roll over any part of the pattern to read a plain-English explanation, and use the Tools menu to explore matches or substitutions.
Building from source
RegExr's build system uses Gulp. To build from source you need Node installed, then run npm install and finally gulp to start a dev server. This is relevant for developers who want to contribute pull requests or customize the tool.
Alternatives
- regex101 — another popular web-based regex tester that provides real-time matching, explanation, and a regex debugger.
FAQ
Is RegExr open source?
Yes. The repository is licensed under GPL v3 and accepts pull requests for contributions.
What regex flavors does RegExr support?
RegExr supports both JavaScript and PHP/PCRE regular expressions. You can switch between the two in the interface.
Can I share my regex patterns with others?
Yes, RegExr lets you save expressions and share them via URLs. The community can also search for and rate shared patterns.
Where do I report bugs or feature requests?
Use the GitHub issue tracker for RegExr. The project asks that general regex questions be posted on Stack Overflow instead.








