The problem is that I want to combine all the text on each side of the comment and exclude the comment itself.
There are many posts related to comments related to comments, but most of them are in other languages (I use notepad ++, which I know is POSIX ERE, does not discuss languages or tools), and most of them focus on looking for comments that I have already made.
This will find the desired text that I want (this will include the comment of the internal block in the match):
(^)rule ((.|\n|\r)*?)(^)end
The above finds something between the "rule" and the "ending", inclusive. Good.
Here a block comment will be found:
(?:/\*(?:(?:[^*]|\*(?!/))*)\*/)
The above finds something between /* and */ , inclusive. Good. I don't care if there can be one of */ inside a comment, not a problem in my case.
Now the question is how to put a block comment in negative in the middle of a matching positive rule so that it matches everything between RULE and END , except for the comment?
Bonus points if your answer excludes one-line comments // .
source share