Free Support Forum - aspose.com

Search after a more complicated string

If certain requriments is forfilled then I need to remove a string from an Aspose document.
This is the line that is sent in (beyond my access)
John Doe\line\nReg \'d6ster\'f6ster\line
This is the line in the doc I need to search for
John Doe\line Reg 'd6ster’f6ster\line\

Can I send the first line in to somekind of Converter that gives the document final string?
I have extreme problems with the escape sign before ’ . C# will always add an escape char to the ’ so I get (two-backspace)’
Any suggestions?Nitha HA0003128 preliminarrapport.zip (21.6 KB)
Nitha HA0003128 preliminarrapportRemoved.zip (21.6 KB)

Added files. One file with text still there and then with text removed

@JerkerPihl,

Thanks for your inquiry. Please ZIP and attach your input and expected output Word documents here for our reference. We will then provide you more information about your query along with code.

I added the current word document above and the result document I want after replace.

@JerkerPihl,

Thanks for sharing the documents. Please use the following code example to replace multi line text. You need to use special meta-characters to specify breaks: &p for paragraph break and &l for manual line break.

Document doc = new Document(MyDir + "Nitha HA0003128 preliminarrapport.rtf");
 
Regex regex = new Regex(@"Analysledare:&pSupport&lRegion Östergötland&l", RegexOptions.Multiline);
doc.Range.Replace(regex, "", new FindReplaceOptions());

doc.Save(MyDir + "18.6.rtf");

Moreover, we suggest you please read following article. Hope this helps you.
Replace Text using Meta-Characters