Mocking.Dev

Regex Tester

Test regular expressions against sample validation text and fixture data.

Regex input

Enter a JavaScript regex pattern, flags, and sample text.

Match result

Matches and capture groups appear after a short delay.

{
  "count": 2,
  "matches": [
    {
      "match": "user_1048",
      "index": 0,
      "groups": [
        "user"
      ]
    },
    {
      "match": "order_7721",
      "index": 10,
      "groups": [
        "order"
      ]
    }
  ]
}

Frequently asked questions

What does this regex tester do?

It builds a regular expression from your pattern and flags, runs it against test text, and shows matched values, positions, and capture groups.

How does it connect to validation and test data?

Regexes are common for validating IDs, slugs, emails, logs, and generated fixture fields before they are used in tests.

Which regex flags can I use?

Use JavaScript RegExp flags such as g, i, m, s, u, v, and y. The tester adds global matching automatically so all matches can be listed.

Similar tools