Developer

ECMAScript regex with live highlights. Flavor differences still bite.

Pattern + flags (g i m s u y) → new RegExp, match list, capture groups, and a replace preview with $1 / $&. This is JavaScript, not PCRE or Kotlin. Nested quantifiers can still hang the tab; we cap iterations.

Flags
Uses String.prototype.replace — supports $&, $1$9, $`, $', $$.
(Enter a replacement string to preview substitution.)

When to use this — and when not to

Use it to tune a JavaScript RegExp against sample text: flags g i m s u y, match table, captures, replace preview ($1, $&).

Do not assume the same pattern is valid in PCRE, Python re, or Kotlin. Lookbehind needs a modern JS engine. Nested quantifiers can still freeze the tab; we cap iterations, we do not make the pattern safe.

What the tester actually does

new RegExp(pattern, flags), then exec in a loop when g is on (otherwise once). Highlights merged ranges in the subject. Replace uses JS String.prototype.replace rules. Strings stay in the tab.

Worked example

Pattern \b\w+@\w+\.\w+\b, flag g, subject with two addresses → two rows in the match table. Without g you only get the first.

Contact: alice@example.com or bob@test.org

That pattern is a demo, not an RFC 5322 email validator. Do not ship it as one.

Mistakes people make

  • Forgetting g and thinking there is only one match.
  • Pasting /pattern/gi including slashes — this field is the source only.
  • Using JS $1 in a sed script that wants \1.

Related

HTTP request builder · APK string extractor

Frequently asked questions

Is this PCRE?

No. ECMAScript RegExp only.

Uploaded?

No. Keep secrets out of the subject anyway.

Tab hung?

Catastrophic backtracking. Simplify the pattern. We cap loops; we cannot cap all engine work.

Lookbehind failed to compile?

Older browsers. Drop the assertion or test in a current Chromium.