Using this sample code and attached file I tried to replace some text ("" as sample) with some any elemnt, but e.MatchNode.Range has invalid part of finded text (only some matches has right text and only if searching from end to beginning). Match is sucess, but Range is invalid.
private void SomeMethod()
Document doc = new Document("sample.rtf");
doc.Range.Replace(new Regex(@"<(?[a-zA-Z0-9_:!]+)>"), new ReplaceEvaluator(ReplaceText), false);
private ReplaceAction ReplaceText(object sender, ReplaceEvaluatorArgs e)
// some logic here
// but for attached sample first occurance^
// e.Match = ""
// e.MatchNode.Range.Text = "/ ___________________/<C" - ??? only two first symbols of match at the and and some other text at the beginning.