Skip to main content
ToolsBay

Runs in your browser — nothing is uploaded · verify

Regex Tester — free, and it runs in your browser

Test regular expressions live with match highlighting and groups.

  • Test a pattern against real text and watch the matches highlight as you type.
  • Capture groups are listed separately, with their contents, for every match.
  • Flags as checkboxes: global, ignore case, multiline, dot all, unicode, sticky.
Flags

0 matches

Enter a pattern to begin.

  • 70 tools

    Free, with no account and no watermark

  • 0 bytes

    Of your files or text uploaded — this tool runs in the tab

  • No queue

    The work happens in this tab, not in a line behind other users

Three steps, nothing to install

Regex Tester in three steps

  1. REGEX123456Paste it in — it never leaves the tab

    Write the pattern and paste the text

    Your expression at the top, the sample it has to work on below. Neither is transmitted anywhere.

  2. REGEXEvery field, broken out and checked

    See what it matched

    Matches are highlighted in the text and listed with their position and every capture group, so you can see why a pattern is doing what it is doing.

  3. Copy MATCHES

    Take the working pattern

    Copy it into your code once the highlighting says what you meant.

Why use Regex Tester

  • Groups shown, not just matches

    Most of the difficulty in a regex is which group captured what. Each match lists its groups with their contents, which is where the bug usually is.

  • The engine you will ship against

    It runs on your browser’s own JavaScript regex engine, so what you see here is what your code will do, rather than a close approximation from another language.

  • Your text stays in the page

    What you paste is not transmitted or stored, so an API response full of customer records, a token or an internal query never leaves your machine.

Frequently asked questions

JavaScript's, since it runs in your browser. It is close to PCRE but not identical — there are no possessive quantifiers or recursion, and lookbehind is supported in modern browsers only.

Testing before you ship

A regular expression is easy to write and hard to be sure about. The failure mode is rarely a syntax error — it is a pattern that works on the three examples you tried and quietly mishandles the fourth. Seeing every match highlighted in place, against realistic input, is the fastest way to find that out.

The flags

  • g — without it you get only the first match, which is the most common surprise.
  • m — makes ^ and $ match at each line break rather than only at the start and end of the whole string.
  • s — lets . match a newline. Without it, . stops at line ends, which breaks patterns meant to span lines.
  • i — case-insensitive matching.

Two things worth avoiding

The first is nested quantifiers. A pattern like (a+)+$ looks harmless and takes exponential time on input that almost matches — enough to freeze a browser tab or take down a server. If a pattern feels slow on a long string, that is usually why.

The second is parsing structured formats with regex. HTML, JSON and CSV all have nesting and quoting rules that regular expressions cannot express correctly. Use the JSON formatter or HTML beautifier instead — a real parser will handle the cases your pattern will not.

  • Text Compare

    Diff two blocks of text and highlight every addition and removal.

  • Find Frequent Words

    Rank the most common words in a text to check keyword density.

  • SQL Formatter

    Indent and align SQL for PostgreSQL, MySQL, SQLite, BigQuery, Snowflake and SQL Server, with keywords capitalised.

  • YAML Validator

    Validate YAML syntax and preview the parsed result as JSON.

  • HTML Beautifier

    Re-indent minified or messy HTML into readable markup.

  • CSS Minifier

    Strip comments and whitespace to shrink a stylesheet.

Related guides

More tools

70 tools, none of which want your file

Everything this tool does happens in the page you are looking at. No account, no upload, no watermark.