Test and debug regular expressions online with real-time matching. Highlight matches and view groups.
Test and debug regular expressions online with real-time matching. Highlight matches and view groups.
Subscribe to get notified about new tools and features.
Enter your regular expression pattern in the pattern input field. The tool supports the full JavaScript regex syntax including character classes, quantifiers, anchors, groups, lookaheads, and lookbehinds.
Set the regex flags: g (global - find all matches), i (case insensitive), m (multiline - ^ and $ match line boundaries), s (dotAll - dot matches newlines), and u (Unicode support).
Paste or type the test string you want to match against in the text area below. The tool highlights all matches in real time as you type both the pattern and the test string.
Review the match results showing each match, its position in the string, and any captured groups. This detailed output helps you verify and debug complex patterns.
Building and debugging regular expressions is one of the most common challenges developers face. This tool provides instant visual feedback showing exactly what your pattern matches, where it matches, and what groups it captures, dramatically reducing the trial-and-error debugging cycle.
The real-time highlighting makes it easy to see unintended matches or missed text. When your pattern captures too much or too little, the visual feedback immediately shows the problem, making regex development significantly faster.
Whether you are validating email addresses, parsing log files, extracting data from text, performing search-and-replace operations, or building input validation rules, this tool lets you test and perfect your patterns before implementing them in your code.
All regex testing runs locally in your browser. Test strings containing sensitive data like log files, user data, or configuration content remain completely private.
The tool helps developers learn regex by showing the immediate effect of each pattern change. The visual match highlighting makes abstract regex concepts tangible and understandable.
Start with a simple pattern and gradually add complexity. Test each addition to verify it matches correctly before adding the next element.
Use non-capturing groups (?:...) when you need to group parts of a pattern but do not need the matched text in the results. This improves performance and keeps your captures clean.
Be cautious with greedy quantifiers (*, +) which match as much text as possible. Use lazy quantifiers (*?, +?) when you want to match as little text as possible.
For complex patterns, add comments using the verbose mode pattern or break the regex into named groups (?<name>...) for self-documenting code.
Always test your regex with edge cases: empty strings, special characters, very long text, and boundary conditions to ensure robust behavior.
A regular expression (regex) is a character sequence that defines a search pattern for matching and manipulating text. Regex is used in virtually every programming language for input validation, search and replace, data extraction, log file parsing, and text formatting. It is an essential skill for developers and system administrators.
The 'g' (global) flag finds all matches instead of stopping at the first. The 'i' flag enables case-insensitive matching. The 'm' (multiline) flag makes ^ and $ match line boundaries. The 's' (dotAll) flag makes dot match newlines. The 'u' (Unicode) flag enables proper handling of Unicode characters and emoji.
A practical email regex pattern is: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$. This matches most standard email formats. However, the official email specification (RFC 5322) allows many unusual formats that are extremely difficult to capture with regex. For production use, it is better to use a simple pattern for basic validation and then verify the email by sending a confirmation message.
Greedy quantifiers (*, +, ?) match as much text as possible while still allowing the overall pattern to succeed. Lazy quantifiers (*?, +?, ??) match as little text as possible. For example, with the text '<b>hello</b><b>world</b>', the greedy pattern '<b>.*</b>' matches everything from the first <b> to the last </b>, while the lazy pattern '<b>.*?</b>' matches each <b>...</b> pair individually.
This tool uses JavaScript's regex engine, which shares most syntax with other languages including Python, Java, C#, PHP, and Ruby. Core features like character classes ([a-z]), quantifiers (*, +, ?), anchors (^, $), and groups work identically across languages. Some advanced features like lookbehinds, possessive quantifiers, and recursive patterns may differ between language implementations.
Yes, completely private. All regex matching happens in your browser using JavaScript's built-in RegExp engine. Your test strings and patterns are never sent to any server, never stored, and never logged. This makes the tool safe for testing patterns against log files, user data, configuration files, and any other sensitive text.
Capturing groups are created by wrapping part of your pattern in parentheses. For example, (\d{3})-(\d{4}) captures two number groups separately. Named groups use (?<name>...) syntax for clarity. Access captures by index or name in your code. Non-capturing groups (?:...) group without capturing.
Format, validate, and beautify your JSON data online. Minify or prettify JSON with syntax highlighting.
Encode text to Base64 or decode Base64 strings online. Supports UTF-8 text and file encoding.
Generate SHA-1, SHA-256, SHA-384, SHA-512 hashes from text online. Free cryptographic hash generator.
Encode or decode URL strings online. Convert special characters to percent-encoding or decode them.