WoluTools

Developer · Browser tool

Test a JavaScript regex and see every match

Type a pattern, set the flags and paste your text. Matches and capture groups are highlighted as you type.

FreeNo account, no job limit, nothing uploaded

  • Uses the regex engine built into your browser, so results match what JavaScript does
  • Match table with index and capture groups, plus a CSV download
  • Plain-English breakdown of the pattern, part by part
  • A pattern that backtracks too long is stopped after 900 ms instead of freezing the tab

Open the full-page tester

Flags

Match table and breakdown

Every match, and what the pattern says

Both panels follow the tester above. Change the pattern or the text and they update.

Match table

Pattern breakdown

From pattern to checked result

  1. 1

    Write the pattern

    Type it between the slashes and tick the flags you need. The line under the flags shows the full expression, for example /\d+/g, ready to copy into your code. A syntax error is shown right away with the browser's own message.

  2. 2

    Paste the text to check

    Paste as many lines as you like, up to 200,000 characters. With the g flag every match in the whole text is highlighted. Turn on m if ^ and $ should apply to each line.

  3. 3

    Read the result

    The match table lists each match with its position and every numbered or named capture group. The breakdown explains the pattern part by part. Download the matches as CSV if you need them elsewhere.

How matching works on this page

One engine: JavaScript

The tester uses the regex engine built into your browser. There is no server call and no second implementation, so what you see is what the same pattern does in JavaScript. PCRE, Python's re, Go's RE2 and the POSIX tools each have their own syntax corners. Lookbehind, named groups and the s flag are recent additions to JavaScript and may not exist where you paste the pattern next.

Patterns that hang a program

Backtracking engines try alternatives when a match fails. A pattern such as (a+)+b run against a long row of the letter a has a huge number of ways to split that row, and the time doubles with each extra character. This is how one bad expression can take down a web service. Here, matching runs on a background thread. After 900 ms the thread is stopped and you get a warning instead of a frozen tab. Nested quantifiers and alternations that can match the same text two ways are the usual cause.

Limits worth knowing

The test text can be up to 200,000 characters. The tester lists the first 500 matches and says so when it stops there. The breakdown covers the constructs JavaScript supports today and describes an unfamiliar part literally rather than guessing. Character classes are summarised by their ranges, not expanded.

Questions before you run it

Which regex flavor does the tester use?

JavaScript only. Matching uses the regex engine built into your browser, so results are what the same pattern does in JavaScript. PCRE, Python and Go handle some syntax differently, lookbehind being one example.

Does the tester explain the pattern?

Yes. Below the tester, the pattern is broken down from left to right and each part is named in plain English. Parts inside a group are indented, and the active flags are described in one sentence.

Can I test several lines at once?

Yes. Paste as many lines as you need, up to 200,000 characters. With the g flag every match is highlighted and listed with its position and capture groups. Turn on the m flag if ^ and $ should match at each line.

Are my patterns or test text sent to a server?

No. Matching and the breakdown run in your browser. Nothing is uploaded or stored.

What happens if a pattern backtracks too long?

Matching runs on a background thread. If it takes longer than 900 ms, the thread is stopped and a warning explains the likely cause, such as a nested quantifier like (a+)+. The page stays responsive.

Can I export the matches?

Yes. Download matches (CSV) saves one row per match with its index, the matched text and one column per capture group.