developer desk · regex tester
Test a regex in the engine your code will use.
Type a JavaScript regular expression and some text: every match, its groups and a replacement preview appear as you type. The pattern runs in this browser’s own engine, in a separate thread, and nothing is sent anywhere.
g all matches · i ignore case · m lines · s dot matches newline · u Unicode · y sticky · d indices · v sets
Not an emulation of another flavour: the pattern runs in the JavaScript engine of the browser you are using, so an error here is the error your code will throw. Chrome, Firefox and Safari word their errors differently, and the message is shown as this one wrote it.
Once the pattern does what you meant
To see exactly what a replacement changed, put the before and after side by side in the diff.
Compare two textsQuestions
Which regex flavour is this?
JavaScript’s, and not an imitation of it: the pattern is compiled by the engine of the browser you are using. A pattern that works here works in your front-end code and in Node on the same engine. PCRE-only syntax, such as possessive quantifiers, is refused as your code would refuse it.
Why did it stop and say the pattern was still backtracking?
Some patterns — nested repetition like (a+)+ is the classic — take exponentially longer as the text grows. JavaScript cannot interrupt a running regex, so this page runs it in a separate thread and ends the thread after one second. On a real page that pattern would freeze the tab instead. Engines differ here: Safari’s gives up by itself after a limit and reports no match, and Firefox’s can stop with a “too much recursion” error, which the page shows as it is.
Is my text sent anywhere?
No. The pattern and the text stay in this tab; nothing is uploaded or stored.