Which regex flavour this tester uses
Patterns run on your browser’s own JavaScript engine, which follows the ECMAScript standard, so they behave as they will in JavaScript or TypeScript running on the same engine; Node.js uses the same engine as Chrome. Other languages differ in details. Python, PHP and Java support some syntax that JavaScript does not, such as possessive quantifiers like a++, and they write some features differently, so a pattern copied from them may fail here with a syntax error. Named groups are written (?<name>…), lookbehind (?<=…) is supported, and the newer v flag, which adds set operations inside character classes, works in recent browsers. When the pattern has an error, the engine’s own message is shown so you can find the problem.
Arabic text and the u flag
In JavaScript, \w, \b and \d cover only the English letters A to Z, the digits 0 to 9 and the underscore, so \w+ finds no Arabic words at all and \b does not mark Arabic word edges. Turn on the u flag and use Unicode property escapes instead: \p{Script=Arabic}+ matches runs of Arabic letters and \p{L} matches a letter in any script. Arabic-Indic digits Ù to Ù© and the Eastern digits Û° to Û¹ used for Persian and Urdu are separate characters that \d does not match, so list them in a class, as the Digits example does. Short vowel marks (tashkeel) are separate characters too, so a word typed with a shadda will not match the same word typed without it; strip them first with the Arabic diacritics remover, or allow \p{M}* after each letter. The test text box sets its direction automatically, so Arabic lines read right to left while the pattern stays left to right.
Groups, positions and replace
Parentheses capture a group that is numbered from the left, (?<name>…) captures a named group, and (?:…) groups without capturing. For every match the tester lists the text, its start and end position and the value of each group; a group that did not take part in the match is marked as not matched. Positions count UTF-16 code units, the same as JavaScript string indexes, so an emoji counts as two. In the replacement, $1 and $<name> insert a group, $& inserts the whole match and $$ writes a plain dollar sign. Without the g flag only the first match is found and replaced, exactly as String.replace does. The CSV download lists up to 5,000 matches with all their groups and opens in Excel or Google Sheets.
Catastrophic backtracking and the time limit
JavaScript regular expressions work by backtracking: when part of a pattern fails, the engine goes back and tries the other ways the earlier parts could have matched. With nested quantifiers such as (a+)+$ or overlapping alternatives such as (a|aa)+$, the number of ways can grow exponentially with the length of a text that does not match, so a few dozen characters can keep the engine busy for minutes. OWASP calls the attack that exploits this ReDoS, regular expression denial of service. Here each test runs in a separate background worker; if it has not finished after 2 seconds, the worker is stopped and you see a warning instead of a frozen page. To fix such a pattern, remove the nesting, make alternatives that cannot match the same text, anchor it, or cap repetition with a range such as {1,50}. A pattern that times out here would block a server in the same way, so fix it before it ships.
Limits and privacy
The text can be up to 2 million characters. The first 100,000 characters are highlighted and the first 200 matches are drawn on the page; the count and the CSV include every match up to 5,000. Nothing is uploaded: the pattern, the text and the results stay in your browser. To check how a pattern treats letter case before you run it on real data, the case converter can produce test text in upper, lower and title case, and the text compare tool shows exactly what a replace changed.