BrokenTools
EN

Regular expression tester (JavaScript)

Test a regular expression on your own text. Matches are highlighted and every group is listed.

    How to use it

    1. Type the pattern and the flags.
    2. Paste the text you want to search.
    3. Read the matches. Add a replacement to see the result.

    Test patterns safely

    Write a regular expression and test it on your own text. Matches are highlighted and every group is listed, so you can see what the pattern captures before you use it in code.

    Flags and groups

    Type the pattern and the flags, such as g for all matches, i to ignore case and m for multiple lines. Groups in brackets are shown separately. Add a replacement text to see what the result would be.

    Good to know

    This tool uses JavaScript regular expressions, which differ a little from other languages. Very complex patterns on long text can be slow. Everything runs in your browser.

    Example: find all the emails in a text

    Type a pattern such as [\w.-]+@[\w.-]+ and paste your text. Every match is highlighted and each group is listed below. Change the flags to match all results, ignore case or work on many lines, and see the result change immediately.

    Quick tips

    Common problems and fixes

    Questions

    Which regex flavour is this?

    The one built into your browser: JavaScript. It is close to most others but not identical.

    What do the flags mean?

    g finds all matches, i ignores letter case, m treats each line separately, s lets the dot match a new line, u turns on full Unicode support.

    Is my text uploaded?

    No. Everything runs in your browser.