Question: I'm trying to select a block of code between 2 comment tags like this:

```
<!-- begin answers -->
   ...[code]
<!-- end answers -->

```

I've tried something along the lines of `<!-- begin answers -->.*<!-- end answers -->` but my regex knowledge is fairly limited. My knowledge of Notepad++'s find and replace is very limited as well, but the reason I'm using it is because of the "Replace Across Open Files" option deems to be very useful. Reason for this because I'm doing a search/replace on about 4000 files.

The code between these comments may vary somewhat (spaces, whitespace) so I need something a little flexible to handle it.

Thanks!

Answer: 
You could use since Notepad++ v~ 6.0+:

search what: `(?<=<!-- begin answers -->\r?\n).*?(?=<!-- end answers -->)`

This will highlight all code that is between `<!-- begin answers -->\r?\n` and `<!-- end answers -->`

Be sure you have tick `Regular Expression` and `dot match newline`
Using the below in Find & Replace (***Regular expression*** and ***.matches newline*** selected) works for me:

```
<!-- begin answers -->(.*?)<!-- end answers -->

```