Regex Match
Create, test and debug regular expressions within a text file
Regex Match is a Visual Studio Code extension that enables dynamically creating, testing and debugging regular expressions within a text file. It provides a simple and user-friendly interface, making the process of working with regular expressions effortless and efficient.
Press Ctrl+Alt+X/Cmd+Alt+X or use the command Regex Match: Open Regex Match Window to open the regex test window, where you can test your regular expressions with the help of highlights. Also, you can create .rgx files to save your regex tests.

Table of Contents
🚀 Features
Test Regular Expressions
Create, test and debug your regex in the Regex Match file. To do this, use this syntax:
/your-regex-here/[flags]
---
test input line 1
test input line 2
test input line n
---

Test Regular Expressions from the Code Editor
With VS Code's CodeLens functionality, Regex Match allows you to test the regular expressions directly from your code. By using the Test Regex CodeLens, you can send the regex from your code to the Regex Match extension for testing. Once edited, you can update the original regex in the code using the Apply Regex to Code CodeLens.

Highlight of Capturing Groups
Each group in a regular expression is highlighted in a different color, making it easy to distinguish and identify them. Color-coded regex capture groups enhance readability and simplify debugging.

Explanation of Regex Tokens on Hover
Hover any character of the regex line in a Regex Match file to see what the token under the cursor does, along with the quantifier, group and character class that enclose it. Hovering a flag explains that flag and the other flags of the regex.

Test Multiple Regular Expressions
You can test multiple regular expressions in the same file. Each regex test should follow the specified syntax, with its own test lines and capture groups. This feature allows you to test different regex patterns independently in the same file.

⚙️ Extension Settings
The following settings are available to customize the extension:
| Setting Type |
Default Value |
Description |
regex-match.codeLens.enabled |
true |
Enable the code lens that allows you to test the regex from the code editor. |
regex-match.colorHighlighting.match |
#FFA50080 |
Color used to highlight the matches. |
regex-match.colorHighlighting.groups |
["#07925C99", "#3164CACC", "#6E25B7B2", "#D339DF99", "#006B6BCC", "#B82F2F99"] |
Colors used to highlight the capturing groups, applied in order and cycled when a match has more groups than colors. |
📝 Release Notes
[v0.8.0] - 12/10/2026
- Added a hover on the regex line that explains each token and flag.
- Scoped invalid regex errors to their own test block, keeping the other blocks highlighted instead of dropping every highlight in the file.
- Replaced the
firstGroup to sixthGroup color settings with a single regex-match.colorHighlighting.groups list, allowing any number of capturing group colors.
- Fixed the decoration types leaking on every color setting change, since the previous ones were never disposed.
[v0.7.2]
- Fixed the test-block end pattern that could never match, causing the rule to consume the entire file from the first regex line to EOF.
[v0.7.1]
- Fixed an issue when there are duplicate regex tests that came from code.
[v0.7.0]
- Added support to create and test multiple regex test files.
- Created a new language grammar for
.rgx files, allowing the use of syntax highlighting.
[v0.6.1]
- Fixed the regex detector to detect regex in arrays.
- Fixed regex detector to detect regex with slash in the middle of its text.
View the full CHANGELOG.
🛠️ Development
Requirements
The following dependencies are required to run the project:
Usage
Install the dependencies:
pnpm install
Build the extension:
pnpm compile
Press F5 to open a new window with the extension loaded.
Press Ctrl+Alt+X/Cmd+Alt+X to open the regex match window.
Testing
To run the interface tests, run the following command:
pnpm test:vsc
To run the unit tests, run the following command:
pnpm test