THE WORKSHOP / REGEX FOR HUMANS
DEV · 0.1.0-dev.12

Interface labels are translated. Rules use controlled English; compiler explanations, diagram labels and exported technical requirements stay in English.

A CLEARER WAY TO COMPILE PATTERNS

Write the rule.
Read the regex.

Write clear rules. Inspect the regex. Test real examples.

01

THE INPUT ✍️

Write your rules

Build a rule

Insert a template before the current line or selection, between the outer anchors. Edit it freely in the rule field.

Each example starts at position 0. Sticky matching starts there and stops at the first gap. Search lists up to 100 matches; global and sticky flags make repeated calls to the copied regex stateful. Input anchors remain absolute with multiline mode. Finite strings, Unicode string properties and nested set union/intersection/subtraction require v. Set complements follow native structural string restrictions.

Already have a regex? Translate it ↙

Paste a JavaScript regex literal with u or v, such as /^[A-Z]{2}-\d{4}$/u. Supported patterns become editable rules with their flags; unsupported syntax is explained. Limit: 16,392 UTF-16 code units, including outer whitespace. Press Ctrl/Cmd + Enter in this field to translate.

02

THE OUTPUT 🔎

Understand the pattern

JAVASCRIPT REGEXPReady
Select a recipe or write a rule
Unicode mode always on
Export to a programming language

Code generation translates supported regex semantics through the shared compiler. Unsupported flags or constructs explain why export is unavailable. Example tests below still use JavaScript.

Compile valid rules to export source code.

      Review the pattern Open to review

      Compile valid rules to review the pattern.

      Analysis inspects structure; it does not run matches or measure backtracking. Example matching still runs in an isolated worker with a time limit.

        How it was built

        RULE → FRAGMENT

        Each rule maps to its generated fragment and compiler explanation.

        Each rule will appear here with its generated fragment and meaning.

        03THE STRUCTURE ↝Explore the patternOPEN THE MAP

        Hover to connect the views. Select a node, or press Enter/Space, to return to its rule.

        Compile valid rules to explore their structure.

        04

        THE PROOF 🧪

        Check the edge cases

        Mark what should match. The workshop shows where the pattern agrees or surprises you. Up to 100 examples; 2,048 UTF-16 code units per string. Longer input is kept but cannot be tested. Leave a field blank to test an empty string.

        Entire string requires a match covering the whole example. Search anywhere lists up to 100 nonoverlapping matches, including empty matches. Positions start at 0 and count UTF-16 code units; an emoji such as 😀 counts as two. Open a match to inspect its captures.

        Test fixtures

        Keep rules, flags, examples and exact expectations in a versioned JSON file. Saving and restoring locally are manual; storage belongs to this browser and can be cleared.

        Download a Markdown snapshot of the build, rules, JavaScript regex, options and intended tests. The export does not run tests.

        Links include your rules, examples and expectations. Anyone with the link can read them.

        No fixture loaded. Import limit: 4 MiB.

        Optional automatic recovery, including unfinished rules and expectation JSON. Stored only in this browser; turning it off removes the draft. Manual saved tests stay separate.

        Draft saving is off.

        Choose a recipe to load example strings.