AIForeverThing
All Tools›Web & Developer

Regex Tester

Test regular expressions in real time with every match highlighted in your text.

How it works

Enter your regex pattern and select flags such as g (global) or i (case-insensitive). The tool constructs a JavaScript RegExp object, then repeatedly calls exec() against your test string. Each match is recorded along with its start/end indexes and any capture groups. To render the highlighted output, the original text is split at match boundaries and wrapped in <mark> tags so every match glows green. Special characters in the input are escaped before rendering so your text is always displayed safely.

FAQ

How do I test a regular expression online?

Enter your pattern (without the surrounding slashes), choose flags such as g or i, then paste your test string. The tool highlights every match and lists indexes and capture groups.

What do regex flags like g, i and m do?

g (global) finds all matches instead of only the first. i (case-insensitive) ignores letter case. m (multiline) makes ^ and $ match the start and end of each line, not just the whole string.

Why is my regex matching nothing?

Common causes are unescaped special characters (like . or *), using the wrong flags, or an unintended greedy match. Verify the pattern syntax and that flags match your intent.

Related tools

Free tools by TUNA — energy supply from vetted manufacturers