NSRegularExpression for stripping HTML Tag

Posted by Prazi on Stack Overflow See other posts from Stack Overflow or by Prazi
Published on 2011-02-09T07:13:32Z Indexed on 2011/02/09 7:25 UTC
Read the original article Hit count: 180

Filed under:
|
|

I am developing a ebook reader app. I have the .ePUB file for the entire ebook where in each topic of the ebook is a html file. I want to implement the search functionality in the app. I am using NSRegularExpression class for searching. Please consider the following html code:

<temp> I am temp in tempo with temptation </temp>

Say for example in the above html code I just want to search for the word temp. Now in above code temp is appearing 5 times -> <temp> </temp> temp tempo temptation. I am looking for a regular expression where I can only extract the whole word "temp". I don't want to consider the word temp in the html tags <temp> </temp>. I also don't want the word tempo and temptation to be considered.

Thanks in advance

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c