Regex RemoveRtf = new Regex("\\{\\*?\\\\[^{}]+}|[{}]|\\\\\\n?[A-Za-z]+\\n?(?:-?\\d+)?[ ]?");
string TextWithRtf = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}{\\colortbl ;\\red8\\green0\\blue0;}{\\*\\generator Msftedit 5.41.15.1515;}\\viewkind4\\uc1\\pard\\cf1\\highlight0\\f0\\fs20 The quick brown fox jumps over a lazy dog.\\par}";
string TextWithoutRtf = RemoveRtf.Replace(TextWithRtf, "");
No comments:
Post a Comment