I am trying to implement something similar to mail merge with regions, but more complex. Region start is indicated with text [Group(p1,p2)], region end is indicated with [/Group], and in between there are parameterized data templates such as [Data(arg1,arg2)].
First, I attempted to implement this using Region.Replace method with a custom IReplacingCallback and a regular expression “[Group(\d+,[\d\w_]+)].*?[/Group]”. This works well, but when start and end of the region are in different cells of a table I don’t get a match, and replacing callback never fires.
Do you have any suggestions on how to implement this? I looked into mail merge and LINQ report functionality but neither allows me to execute custom code to evaluate data templates.
Appreciate your help!