Skip to tester
Veomark

Free · Instant · No signup

Regex Tester

JavaScript regex flags, match table with groups, presets, and a 20k ReDoS cap.

QuotVid daily quote videos across TikTok, Instagram, YouTube, Pinterest, and Facebook

Regex Tester

Tester

JavaScript regular expression body only. Do not wrap in slashes.

Flags

Global (g), case-insensitive (i), multiline (m), DotAll (s), Unicode (u), sticky (y).

One-click starter patterns. Edit after loading.

Evaluation is capped at 20,000 characters to limit catastrophic backtracking.

Calculated Results

Match count

0

Execution time

0.00 ms

Match details

Index Start End Full match Groups
No matches yet.
QuotVid free Pinterest automation trial - auto-post videos every day

Test JavaScript regex without a playground account

Most "regex testers" are fine until the sample is a customer dump or an access log. This page compiles new RegExp(pattern, flags) in your tab. Invalid syntax goes to an assertive alert. Valid syntax walks the test subject and fills a table: match index, start and end character offsets, the full match, and capture groups (numbered, plus named groups when present).

Flag buttons are g, i, m, s, u, and y. Global is on by default so you see every match, not only the first. Sticky (y) still respects lastIndex. DotAll (s) lets . consume newlines. Unicode (u) is required for some property escapes. Mix them the way the JS engine allows. Illegal combinations fail at compile time and show in the alert.

new RegExp(pattern, flags)
test.slice(0, 20000)
performance.now() around exec

Execution time is milliseconds for the match loop, not for rendering the table. Zero-width matches increment lastIndex so /a*/g cannot spin forever. A hard ceiling of 5,000 matches stops a pathological global pattern from building a million table rows.

ReDoS guard and presets

Catastrophic backtracking is a real way to freeze a tab. Nested quantifiers plus a long subject are the usual recipe. This tester slices the subject to 20,000 characters and notes the truncation in a polite status region. That is a brake, not a rewrite of the engine. Keep experimental patterns on short samples.

Presets: Email, URL, IPv4, Phone number, ISO date. They are starters. Email is not RFC 5322. IPv4 rejects 999.1.1.1 via 0-255 octets. ISO date is YYYY-MM-DD digits, not a check that 2026-02-31 is invalid. Edit after load. Load email sample is the same as choosing the Email preset.

Do not wrap the pattern in slashes. Flags live on the buttons, not in the text field. A pattern of /foo/gi will look for a literal slash. If you need to pretty-print JSON that a regex extracted, paste it into the JSON Formatter and Minifier.

Engine differences

This is JavaScript RegExp as implemented by the current browser. It is not PCRE, not Python re, not Go RE2, and not POSIX. Lookbehind works where the browser supports it. Possessive quantifiers do not. If production is RE2 (many gateways), a pattern that works here can still be rejected there. Copy the pattern into the runtime you ship.

Clear empties pattern and subject and restores flag g. For Base64 payloads rather than regex, use the Base64 Encoder and Decoder. For crontab rather than regex, use the Cron Expression Generator.

Frequently Asked Questions (FAQ)

What happens if the pattern is invalid?

new RegExp throws. The message is copied into a live alert (assertive). Match count stays 0 and the table says the pattern did not compile. Fix the syntax (unclosed group, dangling backslash, bad flag combo) and the table updates on the next input event.

How does the 20,000 character cap work?

The test subject is sliced to 20,000 characters before exec. Nested quantifiers on long input can freeze a tab (ReDoS). The cap is a hard stop, not a proof that every pattern is safe. Pathological patterns can still be slow under the cap. Keep samples short when you experiment with .* and nested plus.

Which flags are supported?

The six JavaScript flags this page exposes: g (global), i (case-insensitive), m (multiline ^ $), s (dotAll, dot matches newline), u (Unicode), y (sticky). Without g, only the first match is listed. With g, exec walks until there are no more matches, with a 5,000 match ceiling.

What do the presets actually match?

They are starter patterns, not full RFCs. Email is a practical local@domain check, not RFC 5322. URL looks for http(s) prefixes. IPv4 uses 0-255 octets. Phone is a loose digit run with optional +. ISO date is YYYY-MM-DD digits only, not a calendar validator.