Regex Tester
Test a JavaScript regular expression on text, see the matches and groups, and get a warning for slow patterns. It works with Persian text and \p{…} too.
Runs on your device.
0 characters0 bytes
How to Use It
- Write the pattern and choose the flags.
- Paste the test text. Matches are highlighted as you type.
- See the position and the groups of each match in the table.
Questions and Answers
Why does \d not match Persian digits?
In JavaScript, \d is only the Latin 0 to 9. For Persian digits, use [۰-۹], or \p{Nd} with the u flag.
What is catastrophic backtracking?
A pattern such as (a+)+ tries a huge number of paths on text that almost matches, and its time grows exponentially. This tool runs each pattern in a separate worker and stops it after 2 seconds, so the page does not freeze.
Good to Know
Patterns run with the JavaScript regex engine of your browser, which can differ from PCRE, Python, or Go. Each run stops after 2 seconds. Positions count UTF-16 code units.
Related Tools
- Text Diff CheckerCompare two texts line by line, word by word, or character by character, and see what was added and removed. Copy the result as a patch too.
- Unicode Character InspectorSee each character of a text with its code point, name, category, script, and UTF-8 bytes. Find Arabic yeh, ZWNJ, and invisible characters.