Regex Tester
Test regular expressions online. Highlight matches, extract groups, and replace text in real time.
//g
Test String
What are Regular Expressions?
Regular expressions (regex) are patterns used to match character combinations in strings. They are supported in virtually every programming language and are used for searching, validating, and transforming text.
This tester uses JavaScript's built-in RegExp engine and highlights matches in real time as you type your pattern.
Common Regex Patterns
.Any character (except newline)\dDigit [0-9]\wWord character [a-zA-Z0-9_]\sWhitespace^Start of string/line$End of string/line*Zero or more+One or more?Zero or one (optional){n,m}Between n and m times[abc]Character class(a|b)Group / alternation(?<name>...)Named capture group(?=...)Positive lookahead