I am building an android app which has a webview. The webview will display a html document returned from a server.
Depending on a search string i have to highlight few parts of the html document. If search string is 'hello world' then i have to mark text that matches the regex (hello)|(world*).
I tried this -
I get the html document from server. Search the text with regex using Pattern and Matcher. I replace the matched words with which makes it look like highlighted. Works great when there are no html tags. But screws it up when there are html tags in the document from webserver and when my search string matches one of these tags.
I hope i'm clear. Anybody can help?