Search code examples
iphonehtmlregexregexkitlite

How to use regex to retrieve the content of attribute tag in iPhone?


I am new to iPhone development. I am using RegexkitLite framework to parse and retrieve the particular content from the Html source. I want to retrieve the content in the attribute tag. How should I give regex to achieve it? The Tag is

<a href="http://www.stackoverflow.com" class="11-link-dkred-bold">This is stack overflow HTML</a>

How can I retrieve href content and value between the <a> and </a> tags?


Solution

  • I finally got the output by using

    <a href=([^<]*) class=\"11-link-dkred-bold\"><b>([^<]*)</a>"
    

    I have used \ before the double quotes.Just like printing the " in print statement.