views:

76

answers:

3

Hi to all,

I want parse, with iPhone's NSRegularExpression class, this text:

<td class="rowhead">Uploaded</td><td align="left">652.81 GB</td>

for extract Uploaded and 652.81 text.

Thanks in advanced boys!

A: 

This is a good write-up on how to strip html in Objective c:

http://rudis.net/content/2009/01/21/flatten-html-content-ie-strip-tags-cocoaobjective-c

You can also use NSXMLParser to get specific fields, or use a UIWebView and a javascript selector.

Peter DeWeese
Thank for your reply. I'll want try http://regexkit.sourceforge.net/RegexKitLite/
zezzolo
A: 

This string work perfectly for check the link on a html page:

<a href\s*=\s*\"([^\"]*)\">([^<]*)</a>

I have try rewrite the regex for my goal, but don't work :(

<td\\s*([^\"]*)>([^\"]*)\">([^<]*)</td>
zezzolo
A: 

Although I do think that an xml parser is more suited to parsing xml, here are some regexes:

given the input string specified and replacing with the first group:

[^>]*>([^<]*)<.* results in Uploaded

.*>([^<]*)<.* results in 652.81 GB

You can probably simplify it a little further, but this works.

Peter DeWeese
Tonight i'll try your code! TIA
zezzolo
Thank's very much. Your code it's perfect for my goal! i love you! :D
zezzolo