Skip to content

fix(regex-mutator): support for interpolated string for regex mutator - #3875

Merged
richardwerkman merged 4 commits into
masterfrom
support_interpolated_string_in_regex
Oct 9, 2026
Merged

richardwerkman merged 4 commits into
masterfrom
support_interpolated_string_in_regex

Conversation

@dupdob

@dupdob dupdob commented Sep 29, 2026

Copy link
Copy Markdown
Member

A change in V5 accidentally enabled regexmutation on interpolated string; which is actually not supported in V5.
This PR provides support for those: it generates regular expression mutations for each fixed text part of the interpolated string. The interpolated parts are not considered

Fixes #3872

Copilot AI balanced review requested due to automatic review settings September 29, 2026 06:51
@dupdob dupdob assigned dupdob and unassigned dupdob Sep 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Token escaping and split regex constructs can produce incorrect or missing mutations.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds regex mutation support for fixed portions of interpolated strings.

Changes:

  • Processes interpolated-string text segments separately.
  • Adds a regression unit test.
  • Simplifies constructor filtering and logger initialization.
File Description
RegexMutator.cs Adds interpolated regex mutation handling.
RegexMutatorTest.cs Tests basic interpolated regex mutation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@richardwerkman richardwerkman changed the title Fix support for interpolated string for regex mutator fix(regex-mutator): support for interpolated string for regex mutator Oct 9, 2026
@richardwerkman
richardwerkman enabled auto-merge (squash) October 9, 2026 15:28
@richardwerkman
richardwerkman enabled auto-merge (squash) October 9, 2026 15:31
@richardwerkman

Copy link
Copy Markdown
Member

@dupdob thanks for the quick fix! I'll include this in the next release

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

This was referenced Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interpolated Regex pattern causes InvalidCastException

3 participants