Skip to content

Regular expressions in tables being affected by the refactor #71

@RRead91

Description

@RRead91

Describe the bug

When running the reformatter on a feature file where a table has a "", the reformatter adds an extra .

To Reproduce

Steps to reproduce the behaviour

Run the refactor on the following:

Feature: Demo

  Scenario Outline: demo
     Given I have a regex value "report_\S+\.json"
       And A table with
       | report_\S+\.csv |
       And an outline value <regex>

    Examples:
        | regex            |
        | report_\S+\.html |

Expected behaviour

The feature file is analysed and the regular expressions aren't affected

Actual behaviour

The regex in the tables has been changed, adding extra \s

Feature: Demo issue

  Scenario Outline: demo refactor gherkin issue
    Given I have a regex value "report_\S+\.json"
      And A table with
      | report_\\S+\\.csv |
      And an outline value <regex>

    Examples:
      | regex              |
      | report_\\S+\\.html |

Environment

reformat-gherkin, version 3.0.1
Python 3.12.9
MacOS 15.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions