Developer Utilities

Regex Tester

Test and debug regular expressions with multiple flags.

Regular Expression
//
AI Generate (Cloudflare Workers AI)
Test Text
Common Templates

What is Regex Tester?

Regular expressions (regex) are patterns used for matching text. The regex tester helps you write, test, and debug regular expressions with real-time feedback.

Features

  • Real-time Matching: See matches as you type
  • Flags Support: g (global), i (case-insensitive), m (multiline)
  • Match Highlighting: Visually see matched text
  • Group Capture: View captured groups

Common Patterns

  • Email: /^[\w.-]+@[\w.-]+\.\w+$/
  • URL: /https?:\/\/[\w.-]+/
  • Phone: /\d{3}-\d{4}-\d{4}/

Frequently Asked Questions

Which regex flavor does this tester use?
JavaScript (ECMAScript) regex — exactly what runs in Node.js and browsers. Modern engines support constructs like lookbehind; syntax from other flavors (for example \p{...} without the u flag) may behave differently.
Why does .* match more than I expected?
Quantifiers are greedy by default: .* consumes as much as possible, then backtracks. Use the lazy form .*?, or a negated character class such as [^"]*, to stop at the first delimiter.
Can a regex be dangerous to run in production?
Yes. Nested quantifiers such as (a+)+$ can trigger catastrophic backtracking (ReDoS) on crafted input. Test with long adversarial samples and anchor your patterns where possible.