how to detect a valid rtf string ?

I can of course check if the string begins with “{\rtf1” but this is not bulletproof
is it feasible with a regex search ?

also on the other end, is it possible to detect that the rtfdata of a textarea is standard text and contains no styled text ?

thanks for any advice.

if the user select all text, change the font, it should be a styledtext, but if I check styleruncount, there will be one stylerun only
it is a nice start, but like checking the string starting with, not bulletproof.
anyway thanks for the links Jean-Paul.

You could parse it and see if you get an error.
Or read it and generate it again and compare.