JSONTech

مختبر التعابير النمطية

تطابق فوري مع تمييز

Quick patterns

0 matchesNo matches found

Highlighted output

Iterate on regex patterns with live highlights

Regex is powerful and easy to get wrong. Testing a pattern against real input — with matches, capture groups, and flags visible live — saves hours of guessing. The tester runs JavaScript regex in your browser so you can refine an expression until it matches exactly what you need without writing a single line of code.

Use the tester when you need to

Build a pattern for log parsing

Iterate against real log lines until the expression captures the timestamp, level, or trace ID cleanly.

Validate input with a regex

Test patterns for emails, phone numbers, slugs, or custom IDs against good and bad samples.

Debug a pattern that misbehaves in code

Paste both the expression and the input from your codebase to reproduce a match issue in isolation.

How to test a regex quickly

  1. 1

    Paste your regex into the pattern field.

  2. 2

    Paste sample text into the input area.

  3. 3

    Toggle flags (g, i, m, s) and watch matches highlight live as you adjust the pattern.

Common regex workflows

Build a log-parsing pattern

Iterate live against sample log lines to extract the fields your pipeline needs.

Validate user input formats

Refine a pattern that accepts only the IDs, emails, or codes your system supports.

Test an existing pattern against new edge cases

Drop a tricky input in to confirm whether your production regex still matches correctly.

أدوات ذات صلة

الأسئلة الشائعة

The tester uses JavaScript's built-in regex engine, which matches what runs in browsers and Node.js. Patterns that work here will work in JavaScript code without modification.

When your pattern has parentheses, each match shows the captured groups numbered (or named, if you use (?<name>...) syntax). Click a match to expand the group details.

All standard JavaScript regex flags: g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), and y (sticky). Toggle them in the flags row to see how they change matching.

Different engines support different features. JavaScript regex doesn't include lookbehind in older browsers, possessive quantifiers, or some Unicode property escapes. Test in the engine you'll actually deploy with.

The tester focuses on matching. For replacements, use the matches and capture groups shown here to construct your replace call (str.replace(pattern, replacement)) in your code.