nebxRegexGitHub
Menu

Regex tester

JavaScript flavour
Regular expression
g
Type a pattern to start.
Test string
SubstitutionUse $1, $<name> or $&

Free tool · runs in your browser

Regex tester & debugger

Write a regular expression and see every match and group highlighted as you type. Read a plain-English explanation of the pattern, try substitutions, check test cases and copy ready-made code for six languages.

Stays on your device

Matching runs in your browser with its own JavaScript regex engine. Nothing you type is uploaded. Your current pattern, text and tests are kept in this browser so a refresh doesn't lose them; Clear removes them.

Safe from runaway patterns

Patterns run in a background worker. If one takes longer than 1.5 seconds, usually because of catastrophic backtracking like (a+)+$, it's stopped and you get a warning instead of a frozen tab.

Share without a server

Share link puts the pattern, flags, text and tests in the part of the URL after #, which browsers don't send to the server. Anyone with the link can read them, so don't share secrets.

Shortcuts

F3
Next match
Shift F3
Previous match
Ctrl/⌘ F
Find in the test string
Enter
In the pattern: jump to the test string

Questions

Which regex flavor does it use?

JavaScript (ECMAScript), using your browser's own RegExp engine, so results match what your JavaScript code will do. Other flavors such as PCRE, Python, Java or .NET mostly share the same syntax but differ in details; the code generator warns about the common differences.

Is my pattern or test text uploaded?

No. Matching runs in your browser and nothing is sent to a server. Your work is saved only in this browser. A share link keeps the pattern and text in the part of the URL after #, which browsers don't send to servers.

What happens if my regex is very slow?

Matching runs in a background worker with a time limit. If a pattern takes too long, usually because of catastrophic backtracking such as (a+)+$, it is stopped and you get a warning instead of a frozen page.

Can I test replacements?

Yes. Open Substitution and type a replacement such as $1, $<name>, $& or literal text to preview the result for the whole test string.

Can I generate code from my regex?

Yes. The Code tab writes ready-to-paste snippets for JavaScript, Python, PHP, Go, Java and C#, with the pattern escaped for each language.