In a smartphone app I receive HTML text from a server that I have to parse using regexes because I can't display it as HTML (I can't use a webview). The regexes are very intensive (are many) and the results (being the original text inserted by users that cut and paste text from any source, pdf, rtf, etc.) is not always as good as the website counterpart. So, I want to suggest my boss to change the format the mobile client receives, so that I don't have to parse HTML. Question is: what could be this format?
Asked
Active
Viewed 19 times
0
-
You should probably read this answer http://stackoverflow.com/a/1732454/634120 – martincarlin87 Apr 23 '15 at 08:43
-
I've red that before :-) It's what I'm trying to do: avoid regexes. – Apr 23 '15 at 08:44
-
And no, I can't use an XML parser, because it stops when the HTML is not properly written. – Apr 23 '15 at 08:46
-
1The easiest format to deal with in my opinion is JSON but I don't know if it's possible to get your data into that format. – martincarlin87 Apr 23 '15 at 09:13