To the OP, if you do want to compile the notes (document and/or little sticky) but omit the ##comments## that you’ve made, the method I mentioned above does remove the text selectively from the notes, as well as from the body text.
Ha! It’s unclear which of us gave the appropriate response. I can’t tell for sure if by “inspector notes” the OP means Document Notes or Inspector Comments, and whether there are notes NOT ##delimited## like that that need to be compiled. We make a good team, like the Wonder Twins. Only without the purple body suits.
Unless… are you wearing a purple spandex body suit too?
Replacement syntax can be found in 24.18.1 Advanced Replacement Usage of the user manual PDF (pg. 400). Do note that the token method described here, where you can search for something like ##$@## to capture everything between double-hashes, currently has a flaw in that you can’t take that and replace it with nothing (or indeed, anything that doesn’t contain the $@ token in the With field). So for now the RegEx example above is the way to go. Generally speaking the simple delimiter approach will be more efficient against CPU cycles than running the entire Regular Expression engine—more an issue for large compile outputs, where tweaking for performance can mean the difference between a five minute compile and a 45 second compile.
As noted however, there are some great ways to jot down notes to yourself without having to resort to tricks like these. Inline annotations and linked comments are a great way to jot down ideas and to-do items without them showing up when you compile.
As for Regular Expression syntax, well there have been 500+ page technical manuals written on that particular topic. Even providing a tutorial would be a gratuitous use of space in the Scrivener user manual. Here is a fantastic tutorial on basic regex that will take you into intermediate and advanced usage if you so choose.
The response I was looking for was given by Briar: perfect, works like a charm indeed! But I’m grateful to both Briar and Robert: thanks to both of you!
But … where can such information about the syntax of replacement formulas be found?
Everything I know about Regular Expressions I learned from the first two chapters of shop.oreilly.com/product/9780596528126.do, a few PERL programming books, and ahemregular google searches for “regex for matching ________” or “regex for swapping two things” and the like…
Regular expressions are a dark art with a few limitations to their text matching and manipulative power, but you only really need a handful of tricks to eliminate passages from your text. If you want an in-depth answer to “what does ##.+?## do,” you can just search for “regex ________ operator” where you fill in the blank with the name of the text symbol (google doesn’t do well with punctuation symbols), or just ask. Either Ioa or I will break it down for you, symbol-by-symbol. You’ll learn more from Ioa’s link however. It’s a good resource I highly recommend if you really want to learn regular expressions.