Skip to content

Auto fill incorrectly detects regex modifier as capture group. #173

Description

@MichalMKsiazek

Used Visual Studio

Visual Studio 2026

Are the latest Visual Studio updates installed?

Yes

Content of reqnroll.json (if present)

{
  "$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json",
  "bindingCulture": {
    "name": "en-GB"
  },
  "ide": {
    "editor": {
      "gherkinFormat": {
        "indentAndSteps": false,
        "indentSteps": true
      }
    }
  }
}

Issue Description

When regex flags/modifiers are use in a step definitions (e.g. (?i)) the auto fill incorrectly detects the flag as a capture group:

[Then(@"(?i)Do not receive mimic messages from DRS until base offset ""(.*)""")]
    public void ThenDoNotReceiveMessagesFromDRSBaseOffset(TimeSpan offset, Table table) { }

The resultant auto fill incorrectly place the TimeSpan and Table vars:

And [TimeSpan]Do not receive mimic messages from DRS until base offset "[Table]"

Note that the the extension does not detect the auto filled expresion as valid

Image

Replacing it with the correct form the regex is detected.

Image

Steps to Reproduce

Use extension version 2026.1.477
Use VS 2026 18.3.2
Create a step definition with regex modifier (?<modifer>) and use auto fill step.

Link to a project repository that reproduces the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions