Skip to content
Flavor
ECMAScript
Deadline
500 ms
Runtime
Browser

Compare one regex under two explicit flag sets

Run one unchanged pattern against one unchanged input under baseline and comparison flags, then inspect both match lists.

Local processingNo sign-upKillable worker

Input

Enter baseline flags in the first field and a second complete flag set below.

Local

The first flag set is the baseline; g controls whether each side enumerates repeated matches.

Flags comparison report

Submit the example or replace it with your own values. User matching runs only in a disposable browser worker.

What this tool proves

Explicit ECMAScript behavior

Flags can change enumeration, case handling, anchors, dot behavior, Unicode parsing, indices, and starting-position rules. Holding pattern and text constant makes the flag set the only intentional variable.

A controlled comparison changes flags and nothing else

Flags can change enumeration, case handling, anchors, dot behavior, Unicode parsing, indices, and starting-position rules. Holding pattern and text constant makes the flag set the only intentional variable.

Each side is compiled independently and reports its own flags, match count, match boundaries, captures, and truncation state. A syntax error on either flag set fails the comparison instead of silently dropping an option.

Bounded execution protects the page without hiding risk

Any operation that runs a user pattern is isolated in a disposable Web Worker. Tool Swim terminates that worker after 500 ms, caps patterns at 4 KiB and text at 256 KiB, and never runs user matching on the interface thread.

Pattern, flags, text, replacement, matches, and explanations stay in the current browser tab. The public tool makes no developer API request, stores no preset, and works without an account or telemetry.

Primary references

Questions and answers

Related Regex tools