Development

Regex Tester

Test regular expressions live: matches and groups are highlighted instantly, replacements are shown right away and ready-to-use code for JavaScript, PHP and Python is generated.

  • Runs entirely in your browser
  • No data upload
  • No sign-up
  • Free
Result

      

Guide

How it works

  1. Enter an expression

    Type your regular expression into the top field – or choose a template such as email, URL or date.

  2. Set flags

    Use the switches to decide whether all matches are found (g), upper/lower case is ignored (i) and more.

  3. Check the test text

    Matches are highlighted in the test text. On the right you see each match with its position and groups – a click selects it in the text.

  4. Replace & use

    Try out replacements with $1 or $<name> and copy ready-made code for JavaScript, PHP or Python.

FAQ

Frequently asked questions

Which regex flavor is used?

The tester uses JavaScript’s regular expression engine (ECMAScript), i.e. exactly what applies in the browser and in Node.js. PHP (PCRE) and Python behave the same in the vast majority of cases; differences exist e.g. with lookbehinds, named groups ((?P<name>) in Python) or flags.

Is my input stored or transmitted?

No. Everything runs locally in your browser. The share link also only contains the data in the part after the #, which is not sent to the server.

What do the flags g, i, m, s, u and y mean?

g = all matches (global), i = ignore upper/lower case, m = ^ and $ apply per line, s = the dot also matches line breaks, u = Unicode mode, y = “sticky” (search only from the current position).

Why does the evaluation sometimes abort?

Some expressions such as (a+)+$ can take extremely long with certain texts (“catastrophic backtracking”). The tester calculates in a separate background process and aborts after a short time so that the page does not freeze.