Skip to content
Kiln
Tools

Text

Regex tester

Try a JavaScript regular expression against text on this device. Matches are highlighted, with their positions and capture groups.

It runs in your browser. What you enter stays on this device.

The pattern is tested in this browser. It is not sent to a server.

Optional JavaScript flags: g, i, m, s, u, y, v, and d. Use g to find every match.

Up to 20,000 characters. A pattern that takes too long is stopped.

Updates as you type. Nothing is uploaded.

Examples

Load a sample into the form, then run it.

How to use it

  1. 1Enter the pattern without slashes.
  2. 2Add flags such as g or i when you need them.
  3. 3Paste the text to test. Matches update as you type.
  4. 4Copy the match list, or choose Clear to empty the form.

When it helps

  • Check a pattern before putting it in code.
  • See what each set of parentheses captures.
  • Find every match in a short note or log line.

Good to know

  • The engine is JavaScript. Lookaround and other features follow this browser, not another language.
  • Patterns stay under 300 characters and test text under 20,000 characters.
  • A pattern that does not finish within one second is stopped so the page stays usable.
  • The first 100 matches are shown when a pattern matches more than that.

Questions

Is the pattern or the text uploaded?

No. The test runs in a worker in this browser. The pattern and the text are not sent to a server or included in analytics.

Why was a pattern stopped?

Some patterns take an extremely long time on ordinary text. Kiln stops the worker after one second and leaves the page responsive.

Related tools

  • Text diff

    Text diff

    Compare two texts and see added and removed lines.

    Text

  • JSON formatter

    JSON formatter

    Check JSON, then format or minify it in the browser.

    Developer