Skip to main content

Regex playground

Test regular expressions and preview replacements.

44 characters200K limit

About Regex playground

Try a regular expression against sample text before putting it into code. The playground uses JavaScript regex behavior, including its flags and replacement syntax.

Steps, example, and limitations

How to use it

  1. Enter a pattern, flags, and sample text.
  2. Run the test and inspect matches and capture groups.
  3. Add replacement text when needed and review the replacement preview.

Example

Input

Pattern: \d+
Flags: g
Text: Order 42, item 7

Result

Matches: 42 and 7

Things to know

  • Regex syntax differs between languages; a JavaScript match does not guarantee identical behavior in another engine.
  • Some patterns take too long on certain input. The worker timeout stops an excessive run rather than freezing the page.

Navigation

Find a tool

Favorites, recent, and quick access

Image compressorReduce image file size with adjustable quality.
JSON formatterFormat, validate, and minify JSON data.
Merge PDFCombine multiple PDF files into one document.
Password generatorGenerate random passwords with configurable character sets.

Preferences

These preferences are saved only in this browser.

Tool input stays in memory and is cleared when you leave the page. Downloaded files are managed by your browser. AI model caches, when used, are separate from these preferences.