Open files in VS Code and Cursor / Code and APIs

Test a regex in VS Code

Install the free Regex Preview & Regex Tester by Zovo. A Test regex link appears above each regex in JavaScript, TypeScript, Python, Go, Rust, Java, Kotlin, C#, PHP and Ruby files. Click it and a panel opens beside the editor. Paste your own text and every match is highlighted, with a table of numbered and named groups, a replace preview and a railroad diagram.

Install in VS CodeMarketplace pageOpen VSX (Cursor, Windsurf, VSCodium)JetBrains IDEs

Free, MIT license. Extension ID zovo.zovo-regex-preview, version 0.2.1. Needs VS Code 1.90.0 or newer.

A TypeScript file with Test regex links above each regex, and the Regex Preview panel with a date pattern, 5 highlighted matches, the groups year, month and day, and a replace preview
A TypeScript file with Test regex links above each regex, and the Regex Preview panel with a date pattern, 5 highlighted matches, the groups year, month and day, and a replace preview.

Steps in VS Code

  1. Install Regex Preview from the Marketplace, or press Ctrl+P (Cmd+P on macOS) and run ext install zovo.zovo-regex-preview.
  2. Open a source file and click Test regex above a regex. The panel opens with the pattern, its flags and its flavor.
  3. Type or paste your text in Sample text, or click Load file to use a log or data file.
  4. Read the Matches, Diagram and Explain tabs. Type a replacement to see the replaced text.
  5. In any other file, select the pattern and run Test Selected Text as Regex, or press Ctrl+Alt+M (Cmd+Alt+M on macOS).

Steps in Cursor, Windsurf or VSCodium

  1. Open the Extensions view with Ctrl+Shift+X (Cmd+Shift+X on macOS).
  2. Search for zovo.zovo-regex-preview and click Install. Cursor, Windsurf and VSCodium install from Open VSX, where it is published as zovo/zovo-regex-preview.
  3. If your editor has no gallery, download the .vsix from the Open VSX page and run "Extensions: Install from VSIX...".
  4. Then use it the same way as in VS Code.

What Regex Preview handles

What it does not do

In JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm, CLion and others)

Other options

Install counts and Open VSX status were checked on 9 November 2026. Descriptions in quotes are the extensions' own.

Questions

Can I test a Python or Go regex, not only JavaScript?

Yes. Pick the flavor in the panel. Patterns run in JavaScript, and the panel lists any syntax that works differently in the flavor you picked, so a wrong result does not pass without a warning.

Will a bad pattern freeze VS Code?

No. Each match runs in a background worker with a 1 second limit. A pattern that backtracks without end is stopped, and the panel says so.

Is my sample text sent anywhere?

No. The panel blocks every network request. Your sample text and last pattern are kept in workspace storage on your own machine.

More about Regex Preview

Read the Regex Preview page for every feature and setting, or the source code on GitHub.

Support this work

If this extension saves you time, you can support the work on GitHub Sponsors. Monthly tiers start at $5, and one-time tiers start at $15. Sponsorship is optional, and the tool works the same without it.

Need your format supported?

Open a format request with a sample file, and I reply there whether it can be done. For USD 299 once, through this GitHub Sponsors tier, I add your file format or a missing feature to this extension, with tests, within 7 days.