vscode-text-marker icon indicating copy to clipboard operation
vscode-text-marker copied to clipboard

highlight multiple lines using regex

Open anrisovich opened this issue 4 years ago • 4 comments

Sorry to ask this question here. Obviously, I have not completely figured out the composition of regular expressions - I cannot select text in several lines using a regular expression. My goal is to highlight all the text between the two comments:

<code...

// comment start <code> // comment end

<code...

/* comment start */ <code> /* comment end */

<code...

<!-- comment start --> <code> <!-- comment end -->

anrisovich avatar Oct 03 '21 13:10 anrisovich

How about something like this? Let me know if this works for you.

https://github.com/ryu1kn/vscode-text-marker/issues/56#issuecomment-792643653

ryu1kn avatar Oct 03 '21 13:10 ryu1kn

This is what was needed! And I changed the expression a little: "expression": "# Begin highlight[\\s\\S]*?# End highlight", Adding ? allows you to display each block found separately.

I wonder if it is possible somehow to select not the text, but the entire line as a whole?

anrisovich avatar Oct 03 '21 18:10 anrisovich