DevToolNow

Regex Tester

Test regular expressions with real-time highlighting and match groups. 100% client-side processing.

No data sent to server
Regex Pattern
//g
Flags:
Common Presets
Test String
Highlighted Matches
Matches will be highlighted here...

Related Tools

What is a Regular Expression?

A regular expression (regex or regexp) is a compact language for describing search patterns over strings. The theory dates back to Stephen Cole Kleene's 1956 work on regular languages. Ken Thompson published the foundational regex search algorithm in 1968, and around 1973 separated regex search from the ed editor into the standalone grep tool in early Unix. Modern flavors — JavaScript's ECMAScript regex, PCRE (Perl-compatible), POSIX BRE/ERE, RE2 — extend the original theory with backreferences, lookarounds, and Unicode support.

The two regex worlds

Regex engines split into two architectures. Backtracking engines (Perl, Python, JavaScript, .NET) support powerful features like backreferences and lookarounds but can hit catastrophic blowup on certain patterns (ReDoS). Automaton-based engines (RE2, Hyperscan, Rust's regex) guarantee linear time in input length but drop backreferences. Choose engine based on threat model: if you regex untrusted input, prefer RE2.

When to use regex (and when not)

  • ✅ Tokenizing log lines, validating simple formats, find/replace in editors
  • ✅ Extracting fields from semi-structured text (CSV with quirks, server logs)
  • ❌ Parsing HTML/XML — they're not regular languages; use a real parser
  • ❌ Validating email addresses fully — RFC 5321/5322 require ~5,000-char regex
  • ❌ Parsing JSON, programming languages — use proper grammars

⚠️ Reference Only

Output is generated based on your input and is provided for reference. Results may vary depending on your specific use case, edge cases, or environment-specific behavior. We do not guarantee accuracy of conversions, validations, or computed values.

Always verify critical outputs against official documentation or production environments. We are not responsible for any decisions or losses based on these tool results.