Skip to content
| Marketplace
Sign in
Visual Studio>Tools>RegexSmith
RegexSmith

RegexSmith

Anton Lazouski

|
4 installs
| (0) | Free
Regular expressions explained and tested right in the C# editor: hover a pattern for a plain-language breakdown with its groups in color and sample strings, get warned about patterns that can hang on long input, and try your own samples in a tester that writes the pattern back...
Download

RegexSmith

RegexSmith — regular expressions explained and tested in the C# editor

Hover a pattern, and RegexSmith explains it: a line per piece in plain words ("Exactly 4 digits", "One of the texts: …"), every capture group in its own color, two strings that match and one that does not — checked by the real .NET engine. Patterns that can hang get a squiggle and a fix in Ctrl+. The RegexSmith Tester runs your own samples and writes the pattern back to the code.

Free. Forever. No subscriptions, no trial, no "pro" version, no nag screens, no telemetry, no messages in the Output window or at startup. Patterns and samples stay on your computer.

The only thing we will ever ask — after you have used it for a while — is to rate it on the Marketplace.

📖 Documentation · Visual Studio 2022 and 2026 · x64 and ARM64 · UI in 14 languages


The hover card

Over the pattern of new Regex("…"), the static Regex.IsMatch / Match / Matches / Replace / Split / Count, [GeneratedRegex], [RegularExpression], or a const string of the same file used there — regular, verbatim and raw strings alike. The card shows:

  • the pattern with each group's brackets colored and its inside underlined;
  • a line per piece in plain words, nested under its group, with colored group tags;
  • ✓ Matches (two strings) and ✗ Not (one), checked by the .NET engine with the options of the call;
  • a status: ✓ safe, ⚠ may hang or ✕ not valid with the engine's message;
  • ▶ Test pattern… to open it in the tester.

The hover card

"Safe" means that .NET accepts the pattern and nothing in it can backtrack catastrophically — not that it does what you intend. That is what the samples are for.

Groups underlined in the code

A thin line in the group's color under each capture group, right in the editor; a group inside another sits lower. A long pattern reads at a glance.

Patterns that can hang (RX001)

Nested repetitions like ([a-z0-9]+\.?)+ and overlapping alternatives like (\w|\d)+ can take exponential time on a long string that almost matches. RegexSmith underlines them, and Ctrl+. offers fixes with a before/after preview: make the inner repetition atomic (?>…), or add RegexOptions.NonBacktracking (.NET 7+, offered only when the pattern allows it).

RX001 and its fixes

The tester

Docked next to Find Results; open it from the card, from Ctrl+. (Test this pattern in RegexSmith), from the editor context menu (Test Regex Pattern), or from View › Other Windows › RegexSmith Tester.

  • The pattern, option chips, and a status line: N of M as expected · ms.
  • Samples with ✓ / ✗ / – expectations: a row that does the opposite turns red. Matches tinted, groups underlined, spaces as dots; a run over 1 second stops with ⏱ too slow. Enter adds a sample.
  • The groups of the selected sample in a table, and a Replace tab ($1, ${name}).
  • Copy as unit test for xUnit, NUnit or MSTest, and Revert.
  • Apply to code writes the pattern back as the same kind of literal, with its options, as one Undo — and refuses if that code changed meanwhile.

Samples are remembered per pattern and per solution in %LocalAppData%\RegexSmith\samples.

The tester

Settings

Tools → Options → SmithWorks → RegexSmith: explain patterns on hover, underline capture groups, RX001. Every option has a description.

Options


Questions or ideas? Use the Q & A tab on this page or the Feedback repository. Full documentation: lazowskianton.github.io/VSExtensions/regexsmith.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft