Hi, we have a document template which has multiple option tags with text. The text inside the option tags along with the option tag will be deleted based on the condition. For example, in the attached template, we have 3 options. If the condition met the first option, the rest of the options text along with the tag should be deleted. We have tried the find and replace with regex options, but unable to get the text inside the tags.
TextSelection[] textSelections1 = doc.FindAll(new Regex(@"<Option1>(.+?)</Option1>", RegexOptions.Multiline));
TextSelection[] textSelections2 = doc.FindAll(new Regex(@"<Option1>(.*)</Option1>", RegexOptions.Multiline));
Please help us how to perform this.
Attachment:
POC_Sample_Document_fb7206d1_8fd34253.zip