Regex to parse out title of a post

Deadok

New Member
I'm using cURL to grab a page and I want to parse out the title of the post (the actual text shown on the link, not the title attribute of the \[code\]<a>\[/code\]).The HTML is like this:\[code\]<li class="topic"> <a title="Permanent Link to Blog Post" rel="bookmark" href="http://www.website.com/blog-post/">Title of blog post</a></li>\[/code\]I tried using this code:\[code\]preg_match('/<\a title=\".*\" rel=\"bookmark\" href=http://stackoverflow.com/questions/2008203//".*\">.*<\/a>/', $page, $matches);\[/code\]But it's not working, PHP returns \[code\]Array ( )\[/code\] (an empty array).Can anyone supply me the regex to do this? I've tried online generators but it goes right over my head. Cheers!
 
Back
Top