vscode-highlight icon indicating copy to clipboard operation
vscode-highlight copied to clipboard

Potential bug with multiline flag

Open tejasvi opened this issue 3 years ago • 1 comments

"(^.*)": {
    "regexFlags": "mg",
    "decorations": [ { "color": "red" } ]
},

Above matches only the first line, instead of all lines. Related: #63

tejasvi avatar Apr 27 '21 14:04 tejasvi

I got this working with following expression

"((?:(?:^(?:\/\\*\\s*.*)(?:\\s*\\*\\s*.*)+)(?:\\s*.*\\*\/)\\s*$))": {
        "regexFlags": "gm",
            "decorations": [
                {
                    "overviewRulerColor": "#1411ca",
                    "backgroundColor": "#943da0",
                    "color": "#1f1f1f",
                    "fontWeight": "bold"
                },
                {
                    "backgroundColor": "#a04c3d",
                    "color": "#1f1f1f"
                }
        ]
}

It should match multiline comments where each new line between /* */ starts with an asterisk

/*
* line
  * another
    * one more
*/

pintoflager avatar Dec 05 '23 18:12 pintoflager