SeitenreportSEO & website analysis since 2007

Free · without registration

Testing regular expressions and understanding hits

Test regular expressions on your own examples. See hits and groups, or check a replacement before applying the pattern to your application.

Entry and options

Completely local in the browser · no upload · maximum 500 KB input · test text up to 100,000 characters

Enter sample, flag and test text separately

Enter the pattern without enclosing /.../ characters and select the JavaScript flags in your own field. g searches for multiple hits, i ignores upper case, m changes line anchors and s also allows the point to capture line breaks. Which newer flags are available depends on the current browser. Syntax errors appear instead of silently rewriting the pattern.

Recognize hit groups and positions

The result indicates the full hit, numbered groups and named groups. Start and end are zero-based UTF-16 positions; an emoji can therefore occupy more than one position. Empty hits are forwarded in a controlled manner. A maximum of 500 hits are issued so that extensive text tests remain clear.

Control replacements before deployment

Activate the replacement by, for example, $1 for the first group, $& for the entire hit, or $ for a nominated group. Without a global flag, only the first hit is replaced. For more than 500 hits, a potentially misleading partial replacement is not issued. The resulting text file can be downloaded.

JavaScript is not PCRE or RE2

The evaluation uses the RegExp engine of your browser. Search patterns for PHP, Nginx, Apache or Search Console may have different rules. For these tasks you use the linked specialized tools. The syntax reference documented JavaScript RegExp.

Problematic patterns do not slow down the page

The exam runs in a separate worker and is aborted after three seconds. You can also stop them manually. The pattern is limited to 2,000 characters, the test text to 100,000 characters. Very elaborate traceability can still lead to the time limit; then reduce the text or formulate the pattern more clearly.

Example of classification

With /product/(\d+) as a pattern and g as a flag, /product/123 becomes group 1 with the value 123. The replacement /article/$1 creates /article/123.

Frequent questions

Which RegEx engine is used?

The JavaScript RegExp engine of your browser. PCRE, RE2 and server configurations are not simulated.

Will my test text be transferred?

No. Patterns, test text, hits and replacements remain in the browser.

Why does a valid pattern break?

Syntactically valid patterns can also be very slow. After three seconds, the worker is finished so that the surface remains operable.