Regex Tester

Test a regular expression against sample text. See every match with its position, and watch matches light up in the highlighted view.

Matches (0)
    Highlighted text
    
        

    How to use the regex tester

    A regular expression ("regex") is a pattern language for finding and manipulating text. Developers use it for validation (does this look like an email?), extraction (pull all numbers out of a string), and search-and-replace across logs and source code.

    Type a pattern, optionally add flags such as g (global), i (case-insensitive), or m (multiline), and type or paste the test text. The tool evaluates the pattern immediately and lists every match together with its zero-based character index. The text below is also re-rendered with every match highlighted, so you can see exactly which characters were consumed.

    If the pattern is invalid — an unterminated character class, an unmatched parenthesis, or an illegal quantifier — the tool reports the engine's error message instead of throwing an unhandled exception, so you can correct the pattern and keep going.

    Example patterns to try

    • a+ on baaac → matches aaa at index 1.
    • \d+ on order 123 and 45 → matches 123 and 45.
    • \b\w+@\w+\.\w+\b extracts simple email addresses.

    More developer tools