Regex Tester

/ /

# Index Match Groups

About Regex Tester

Write the pattern on top, paste the text below. Matches get highlighted, and a table lists the position and capture groups of each one.

All five flags are available: g for global, i for case-insensitive, m for multiline, s to let the dot match newlines, and u for Unicode mode. Results are listed even without g, so you see everything at once.

A malformed pattern reports the error instead of failing quietly, and zero-length matches are handled so the page cannot lock up.

Frequently asked questions

Does it support lookbehind?

Yes. Modern browsers implement it, written as (?<=...).

Why does Java or Python give different results?

Regex dialects differ. This runs the JavaScript engine, so its syntax is the reference here.

Can it do replacements?

No, this page only tests matching. Take the pattern back into your code for that.

Related tools

Encoding View all ›