Skip to content

One issue and feature request with Multiline Regex Check template #10

@leojosefm

Description

@leojosefm

I'm facing one issue with multi-line regex. It is working fine when I tested in https://regex101.com but not working as expected when the rule is executed.

Requirement : I want to find all the tabs (///$tab) except QDF & Main when succeeding line is not commented (//)

Expression : (?m)\/\/\/\$tab\s(?!(QDF|(?i)MAIN))(.*\n)(?!(\/\/.*))

Issue
In below example, only tab1 should be captured as the succeeding line is not commented.

image

But when I executed it in Sonarqube, even if the subsequent line is commented, the code is captured as a code-smell.

image

Feature request:
Only the first match is being captured. I would like to capture n issues if there are n-tabs in my text file with no comments (starting with //) in subsequent line.

I'm a beginner with both Regular expression and Sonar-qube, so could you please advise if it's something wrong with the expression/template that I use

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