notadevblog
Esc

    Regex Tester (JavaScript)

    Test JavaScript regular expressions live: highlighted matches, capture groups, named groups and replace preview. Runs in a sandboxed worker, so a runaway pattern cannot freeze the page.

    / /g
    Examples:

    Matches

      Result
       

      How to Use

      1. 01 Write the pattern Type the pattern without slashes and toggle flags like g (all matches), i (ignore case) or m (multiline).
      2. 02 Paste test text Matches are highlighted and listed with their position and capture groups.
      3. 03 Try a replacement Use $1, $2 or $<name> in the replacement to see the result of String.replace().

      About this tool

      Regular expressions describe text patterns. They are great for validation and search-and-replace, but hard to read. Test them against real examples, including the cases that should not match.

      Frequently Asked Questions

      More tools

      Cookie settings

      Here you can customize your cookie preferences.

      Necessary

      Essential for website functionality and security

      Preferences

      Remember your settings