Regex tester
Try your regular expression on a piece of text: matches are highlighted, groups are listed in a table and the replacement is previewed.
Match details
How to use it
- Choose the pattern and flags and type the test text; matches are highlighted as you type.
- In the replacement you can use $1, $<name> and $&; the result is previewed below.
- The pattern runs on your browser's JavaScript engine. A pattern that gets too slow is stopped after 1 second, so the page does not freeze.
FAQ
Which regex syntax is used?
JavaScript (ECMAScript) syntax. It is largely the same as PCRE (PHP), Python and Go; differences: inline flags such as (?i), \A and \Z, possessive quantifiers and recursion do not exist in JavaScript. Named groups are written (?<name>...).
Why was the pattern stopped?
Nested quantifiers (such as (a+)+) can cause exponential backtracking on some inputs (ReDoS). The tool runs the pattern in a separate thread and stops it after 1 second. The same pattern will be slow on your server too.
How long can the test text be?
Up to 1 MB. Highlighting covers the first 5000 matches and the table the first 500; the total count is always exact.
Can you see the data I paste?
No. The tools run in your browser; what you enter is not sent to our server and is not stored anywhere. When you open the page, the web server keeps an access log as on any site (IP address, date, requested address, browser identifier); it contains none of your data and is deleted after about 10 days. Your browser remembers only your preferences (such as indentation). See the privacy policy for details.