Toolflix

Regex Tester

Test and debug JavaScript regular expressions in real time. See highlighted matches, captured groups, flags, and replace output. Start from common patterns for emails, URLs, phone numbers, dates, HTML tags, and more.

//g

How to Use This Regex Tester

Enter your regex pattern in the pattern field and your test text in the text area below. Matches are highlighted in real-time as you type. Toggle flags (g, i, m, s) to modify matching behavior. Use Replace mode to test string replacements with capture group references ($1, $2). Click any common pattern button to quickly load frequently used regex patterns.

Regex Flags

g (global) matches all occurrences, not just the first. i (case-insensitive) ignores letter case. m (multiline) makes ^ and $ match line boundaries. s (dotAll) makes . match newline characters.

Common regex checks you can run here

Use this page as a quick JavaScript regex sandbox before pasting a pattern into code, forms, analytics filters, or content cleanup scripts.

  • Validate common formats

    Try email, URL, US phone, IPv4, hex color, and date patterns from the built-in pattern library.

  • Debug capture groups

    Check exactly what each group returns before using $1, $2, or named logic in your app.

  • Preview find and replace

    Switch on replace mode to test cleanup rules for text, CSV snippets, logs, or copied HTML.

  • Keep private text local

    Matching runs in your browser, so sample text is not uploaded to Toolflix.

Frequently Asked Questions

Is my data safe?

Yes. All regex matching happens in your browser. No data is sent to any server.

Which regex engine is used?

This tool uses JavaScript's built-in RegExp engine, which follows the ECMAScript specification. Syntax and behavior match what you would get in Node.js or any modern browser.

Can I test regex replace output?

Yes. Turn on Replace mode, enter a replacement string, and preview the result before using the expression in JavaScript, Node.js, or browser code.

Related Tools