Regex tester

Write the pattern, paste a sample, see what it catches. Every match is listed with where it starts and what each capture group holds.

How it works

  1. Type the pattern without the surrounding slashes.
  2. Set the flags and paste the text to search.
  3. Press Check and read the matches.

Which regex flavour is this?

JavaScript (ECMAScript), as in Node.js and browsers: named groups, lookbehind and Unicode property escapes with the u flag are supported.

What do the flags mean?

g finds every match, i ignores case, m makes ^ and $ match at line breaks, s lets the dot match line breaks, u turns on full Unicode.

Why did it say my pattern takes too long?

Nested quantifiers such as (a+)+ can take exponential time on some inputs. The tester stops a pattern after a quarter of a second; rewrite it without the nesting.

Use it from ChatGPT, Claude or your own agent

This tool is also a function an AI agent can call for you. It needs the same free account as this page, nothing else.

Fields

  • pattern (text, required): Pattern
  • flags (text, optional): Flags. Any of d g i m s u y
  • text (text, required): Text to search

A call that works

POST https://orkosi.com/api/v1/public/tools/regex-tester/run
Authorization: Bearer <api_key>

{
  "input": {
    "pattern": "(\\w+)@(\\w+)\\.com",
    "flags": "g",
    "text": "Write to ana@example.com or ben@orkosi.com, not to carl@example.org."
  }
}

Need an account? One request creates it and answers the key: POST https://orkosi.com/api/v1/public/signup. In Claude or ChatGPT, add the Orkosi connector and sign in: https://orkosi.com/api/v1/public/mcp.

This tool as Markdown · Connect an AI assistant