UNITMONKEY

Regular Expression Tester

Test and debug regular expressions with real-time matching


//g

No matches found

Regular Expressions (Regex) Tester

Regular expressions (regex) are powerful pattern matching tools used in programming and text processing. They allow you to search, match, and manipulate text based on patterns rather than exact strings.

Common Regex Patterns

  • Email validation: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
  • URL matching: https?://[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?
  • Phone number: $\d{3}$\s\d{3}-\d{4} (for format (123) 456-7890)

Regex Special Characters

  • . - Matches any character except newline
  • * - Matches 0 or more of the preceding character
  • + - Matches 1 or more of the preceding character
  • ? - Makes the preceding character optional
  • ^ - Matches the start of a string
  • $ - Matches the end of a string
  • [ ] - Character class, matches any character inside the brackets
  • ( ) - Groups patterns together and captures the matched text
  • | - Alternation, matches either the pattern before or after the |