Regex Tester

Test regular expressions with live match highlighting, capture groups, and flag controls.

Pattern
//
Test String
Match Highlights

What is a Regular Expression (Regex)?

A regular expression is a sequence of characters that defines a search pattern. Regex is used for string matching, validation, parsing, and text extraction in virtually all programming languages.

Regex Flags

  • g — Global: find all matches
  • i — Case-insensitive
  • m — Multiline: ^ and $ match line boundaries
  • s — Dot-All: . matches newlines

Common Patterns

  • Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
  • URL: https?:\/\/([\w\-]+(\.[\w\-]+)+)(\/\S*)?
  • IPv4: (\d{1,3}\.){3}\d{1,3}

FAQ

Why is my regex not matching?
Check your flags — without g, only the first match returns. Verify escapes too.
Does this use JavaScript regex syntax?
Yes — this uses the JavaScript RegExp engine, slightly different from PCRE for lookaheads and named groups.

Tools developers reach for alongside regex testing — UUIDs, timestamps, encoders and more.