Ad · 728x90

Regex Tester & Regular Expression Checker

Test and debug regular expressions in real time. See matches highlighted, group captures, and test against multiple lines.

Regular Expression Tester

/ /
Ad · 336x280

Regular Expressions Explained

A regular expression (regex) is a pattern that describes a set of strings. Regex is used in every programming language for text search, validation, extraction, and replacement. Learning regex is one of the highest-leverage skills for any developer or data professional.

Regex Quick Reference

  • . — Any character except newline
  • \d — Digit [0-9] | \w — Word character [A-Za-z0-9_] | \s — Whitespace
  • ^ — Start of string/line | $ — End of string/line
  • + — One or more | * — Zero or more | ? — Zero or one
  • {n,m} — Between n and m repetitions
  • (abc) — Capture group | (?:abc) — Non-capturing group
  • [abc] — Character class | [^abc] — Negated class
  • a|b — Alternation (a or b)

Useful Regex Patterns

  • Email: [\w.-]+@[\w.-]+\.\w{2,}
  • URL: https?://[\w.-]+(?:/[\w./?=&#%-]*)?
  • Phone (US): (\+1[-.\s]?)?\(?\d{3}\)?[-.\s]\d{3}[-.\s]\d{4}
  • IPv4: (\d{1,3}\.){3}\d{1,3}
  • Hex color: #([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})

Frequently Asked Questions