Word Counter
Count words, characters, and analyze text.
Test your regex patterns in real-time with instant match highlighting, capture groups, and replace mode.
Regex Pattern
Sample Text
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Regular expressions are used in programming, text editors, and command-line tools to find, match, validate, and manipulate strings of text. They provide a concise and flexible way to identify patterns such as email addresses, phone numbers, URLs, dates, and virtually any structured text format.
Originally developed in the 1950s by mathematician Stephen Cole Kleene, regular expressions are now a fundamental tool in every developer's toolkit. They are supported natively by JavaScript, Python, Java, PHP, Ruby, Go, and virtually every modern programming language.
., *,+, ?, (, ), [,], {}, |, \, and ^ have special meaning. Prefix them with a backslash to match them literally..* are greedy by default and will match as much text as possible. Use .*? for non-greedy (lazy) matching.^ and $ to match the start and end of a string. Without anchors, partial matches may pass validation.(?:...) instead of (...) for better performance.(a+)+ can cause catastrophic backtracking. Keep patterns simple and specific.Capture groups are portions of a pattern enclosed in parentheses, e.g. (\d+). They let you extract specific parts of a match. Group 0 is always the full match, and subsequent groups correspond to each pair of parentheses from left to right.
Greedy quantifiers (.*, .+) match as much text as possible, while lazy quantifiers (.*?, .+?) match as little as possible. For example, given "<b>hello</b>", the pattern <.*> greedily matches the entire string, but <.*?> matches just "<b>".
A common email pattern is ^[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}$. For URLs, https?://[\w.-]+(/[\w./-]*)? covers most cases. These are simplified patterns — production use often requires more comprehensive validation.
g (global) finds all matches, not just the first. i (case-insensitive) ignores letter casing. m (multiline) makes ^ and $ match line boundaries. s (dotall) makes . match newline characters as well.
Prefix the special character with a backslash to escape it. For example, \. matches a literal dot and \* matches a literal asterisk. Inside a character class like [.], most special characters lose their special meaning.
Free Regex Tester & Debugger Online — Match, Replace, Capture Groups is completely free and runs in your browser.
No. Free Regex Tester & Debugger Online — Match, Replace, Capture Groups processes input directly in your browser.
No account is required to use Free Regex Tester & Debugger Online — Match, Replace, Capture Groups.
Privacy-first by design
Tool inputs are processed in your browser. Review the Privacy Policy and Terms for full details.
Count words, characters, and analyze text.
Use ready regex patterns with explanations and built-in testing.
Inspect query parameters as key/value pairs.
Search HTTP status codes with examples, copy snippets, and API guidance.