DevPocket
Regex tester
Type a pattern and some test text and you will see every match highlighted instantly, with its position and the value of each capture group, including named groups. You can also test a replacement with $1 or $<name>.
Whatever you paste into DevPocket is processed in your browser and is neither stored nor sent.
Loading the tool…
It includes examples for emails, URLs, ISO dates, Spanish phone numbers and postal codes, IPv4 addresses and hex colors. Each expression runs in an isolated worker with a time limit: if a pattern suffers catastrophic backtracking it is stopped without freezing the page.
How to use it
- Type the expression or pick an example.
- Turn on the flags you need (g, i, m, s, u, y).
- Review the matches, the groups and, optionally, the replacement result.
Frequently asked questions
What is catastrophic backtracking?
It happens when a pattern with nested quantifiers, such as (a+)+, tries an exponential number of combinations on certain inputs. It can freeze a program for minutes, which is why each test here has a time limit.
Does it work for Python, PHP or Java expressions?
The basic syntax is very similar, but the JavaScript engine is used. Some features, such as variable-length lookbehind or certain flags, may behave differently in other languages.
Limitations
- Regular expressions use the JavaScript engine; syntax may differ from PCRE, Python or Java.
- The text diff is designed for documents up to about 2 MB.