Test and debug JavaScript regular expressions live with flag toggles, match highlighting, capture-group details, and instant error hints fully offline.
Part of our Developer Tools collection — Explore more Developer Tools tools · See also: JSON Formatter, Base64 Encode / Decode.
Quick answer: Regex Tester — Test JavaScript regular expressions Free, no signup, runs in your browser. See below for the interactive tool, 4-step guide and FAQs.
Enter a JavaScript-style regex pattern.
No matches yet.
Deep dives from the Tool4SaaS blog — tested workflows, print sizes and fixes.
Reviewed by the Tool4SaaS Editorial Team — In-house reviewers who build and test every tool locally for accuracy across current Chrome, Edge, Firefox, and Safari. Last updated: . See our authors, methodology or contact us.
Standard JavaScript syntax with g, i, m and s flags alongside groups, lookarounds, and named captures. For illustration, backslash d and locates 42 inside Order 42, while flag g lists all 15 hits. A 120KB log holding 4000 lines evaluates instantly, with match indexes and group values displayed for copying.
No. Scanning executes solely inside this tab, so a 120KB log holding 4000 lines never traverses networks. For instance, private identifiers remain resident, function. Everything is computed in this tab; nothing is sent out in any direction. Test proprietary samples confidently here without external exposure.
Texts near 500KB with 20000 lines highlight smoothly, whereas nested quantifiers like and inside and may stall tabs through catastrophic backtracking. For example, prefer bounded ranges such as 0 to 80 characters over greedy dot star. Split 5MB dumps into chapters, simplify alternations, and test incrementally to preserve responsiveness on modest devices.
Groups capture subparts for reuse, while plain includes merely reports presence without structure. For example, four-digit dash two-digit pattern on 2024-05-01 stores year 2024 and month 05 separately, enabling reformatting. Named groups label results for readable code. Exploit captures for log parsing, date reshaping and URL rewriting where includes would demand manual slicing across large corpora.
This laboratory evaluates JavaScript patterns live with glowing highlights, group inventories and precise error guidance. Example 1: backslash d and finds 42 inside Order 42 ships, revealing numeric tokens for extraction. Example 2: capital A to Z and discovers promo codes across 200 lines, while flag g returns all 15 hits versus first only. Flags reshape scope: i ignores case, m anchors each line, s lets dot cross newlines. Developers validate forms, parse logs, and refactor bulk text confidently. Immediate feedback shortens trial cycles, prevents faulty deployments, and builds intuition for quantifiers, alternations and boundary assertions across real datasets. Sandbox drills rewriting greedy stars into negated classes sharpen instincts while cutting catastrophic backtracking across production logs during nightly reviews.
Reference capture table: parentheses create numbered groups | question colon makes non-capturing clusters | named syntax labels groups for clarity | backslash 1 reuses first group | flag g lists all matches | flag i folds case. Parenthesized four-digit dash two-digit on 2024-05-01 stores year 2024 as first value and month 05 as second with start index 9. Non-capturing clusters accelerate 300-match scans. Edge case: greedy dot star spanning mail bodies may swallow delimiters, so prefer negated classes like 0 to 80 non-comma characters. Copy slash-wrapped patterns and flags directly into source files for deployment. Benchmark 300-match scans comparing capturing versus non-capturing clusters to quantify memory savings across high-volume ingestion pipelines before committing helpers to shared libraries for reuse daily.
Test Order 42 ships on 2024-05-01 with backslash d and backslash g flag to list 42 and date fragments, then isolate year month with grouped pattern for reformatting. Second drill: scan a 120KB log holding 4000 lines for error codes, confirming 15 hits highlight within a second. Limitation: nested repeats like a and inside and dollar freeze on 30 a letters and b through exponential paths; rewrite as specific a and dollar. For textual difference review after pattern work, see the comparator at /text-diff for line alignment. Very large 5MB dumps should split to preserve interactivity. Rehearse atomic grouping and possessive quantifiers on staging copies to tame pathological inputs without freezing browsers while documenting safe patterns for teammates.