Actually, if I remember correctly, all tags begin with \
{ and } denote group boundries, like all data belonging to the header group,
for example.
The tricky part with RTF parsers is that every time you see a \ you need to
make sure it really is a tag following it, becuase if it's \\, then it's a
literal backslash.
Some tags like \b are simple (bold), other tags, like non-standard unicode
characters are longer and more complex \uXXXX where XXXX is a number.
There's a special tag, something like \* , that means non-standard markup is
about to be used, and RTF parsers that don't understand the code should
ignore the contents following.
The RegEx isn't going to be simple
-Rob [MVP]
Dmitriy Lapshin said:
Hi,
I think you could strip all RTF tag with a regular expression. As far as I
know, every RTF tag opens with "{" and ends with "}" (you should refer to
RTF format docs to be sure of that). Then, construct a regexp like this:
\{[^\}]+\} and replace every match with empty string.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
Christian Jung said:
Hello,
does someone know if there is an easy way to check if a string which
contains an RTF-text is empty? I mean that the plain text (without
RFT-markers) is empty. What I know is that I can use a RichTextBox to do
that, but I cannot imagine that I have to use a control with all its
overhead just to parse an RTF-text.
Thanks for any idea...
Christian Jung