Skip to content
Sharpsloth

Test a regular expression

See what a pattern matches. Run a JavaScript regular expression against sample text and copy the matches. The pattern and the text stay in this browser.

What you can do

  • See which parts of your sample text a pattern matches.
  • Add flags such as i or m.
  • Copy the matches, one per line.

How this works

The pattern uses JavaScript regular expressions, the same kind a browser uses. Paste sample text and the matches are marked in it and listed, and you can copy them, one per line. The first 500 are listed.

The g flag is always on. Add i, m, s, u, or y in the flags field, or paste the pattern as /pattern/flags. A pattern that is too broad, such as .*, matches everything, and a pattern that takes more than a second is stopped.

The pattern and the sample stay in this browser.

Common Questions

Which flavor is this?

JavaScript regular expressions, the ones browsers use.

Does anything leave this browser?

No. The work stays on this device.

Related

Cookies

Necessary cookies stay on. Optional categories are off until you accept them. Reject is the same as leaving them off.