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.