ryu1kn / vscode-text-marker

Visual Studio Code Extension. Select text in your code and mark all matches. The marking colour is configurable
https://marketplace.visualstudio.com/items?itemName=ryu1kn.text-marker
MIT License
87 stars 17 forks source link

highlight multiple lines using regex #69

Open anrisovich opened 2 years ago

anrisovich commented 2 years ago

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 -->

ryu1kn commented 2 years ago

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

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

anrisovich commented 2 years ago

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?