Regex Tester

Tests a regular expression against text and lists every match with its position, numbered capture groups, and named groups. Enter the pattern, then a line containing "===", then the text to search.

Ad placeholder: Resp_Horizantal_1 (horizontal)
Ad placeholder: Resp_Square_1 (square)

Tests a regular expression against text and lists every match with its position, numbered capture groups, and named groups. Enter the pattern, then a line containing "===", then the text to search.

Write the pattern on its own for a global search, or use the /pattern/flags form to control the flags: g for every match, i for case-insensitive, m for multiline anchors, s to let the dot match newlines, and u or v for unicode. Runs entirely in your browser — nothing is sent to a server.

Use cases

  • Checking a pattern matches what you expect before using it in code
  • Pulling the capture groups out of a sample line of log output

Examples

Finding numbers

\d+
===
ab 12 cd 345
{
  "pattern": "\\d+",
  "flags": "g",
  "matchCount": 2,
  "matches": [
    {
      "match": "12",
      "index": 3
    },
    {
      "match": "345",
      "index": 9
    }
  ]
}

FAQ

Is my text sent to a server?

No — this tool runs entirely in your browser. That is deliberate: a pattern that backtracks badly would tie up a shared server, whereas here the only thing affected is your own tab.

Which flavour of regular expression is this?

JavaScript's, which is what runs in the browser and in Node. Lookbehind, named groups, and unicode property escapes are all supported.

Why do I only get one match?

Without the g flag a regular expression stops at the first match. A bare pattern is given the g flag automatically; /pattern/ without it is not.

Is there a limit?

The text is limited to 20,000 characters and the first 100 matches are listed, with the result marked as truncated beyond that.