Visual debugging, ReDoS detection, and multi-language code generation
Stored only in this browser.
Enter a pattern and a test string to highlight matches and inspect captured groups. The Visualizer tab draws a railroad diagram, the Explainer tab describes the pattern part by part, and the Code Generator produces snippets for JavaScript, Python, Go, PHP, Java and Rust.
Follow the line from left to right. Boxes are things that must be matched. A branch means any one of the paths can be taken, a path that skips a box means it is optional, and a loop means it can repeat.
g finds all matches, i ignores case, m makes ^ and $ match at each line, and s lets the dot match line breaks.
Nested repetition such as (a+)+ can take exponential time on some inputs in backtracking engines. This is called ReDoS. The checker warns about risky structures, but a clean result is not proof of safety, so limit input length for untrusted text.
It draws the structure of a regular expression as a diagram, so you can see alternatives, optional parts and repetition.
No. Basic syntax is shared, but features such as lookbehind, named groups and flags differ between engines. Test the pattern in your target language.
Regular expression denial of service happens when a crafted input makes a backtracking pattern run for a very long time.