When using a custom Range.Replace IReplacingCallback and FindReplaceOptions is there a way to ignore runs inside of a comment?
I have code that looks for the first character in a document using the regex: ^. and adds a comment. If there is an existing comment at the start of the document, sometimes it finds the run inside the comment first. In my custom IReplacingCallback I can determine that the run is inside a comment and skip that result, but ^. Regex only matches the first character of a document, not the first character of each paragraph, so skipping doesn’t help me get to the first run outside of a comment.
On FindReplaceOptions would it be possible to have an IgnoreComments property similar to the existing IgnoreDeleted and IgnoreFields properties. Or better yet, it would be wonderful if the RegexOptions.Multiline was honored when performing a search. I have a separate thread that I just posted in with an additional example today where I have brought up this issue before. document.Range.Replace regex string anchors not working