php regex expression to get title

Posted by 55skidoo on Stack Overflow See other posts from Stack Overflow or by 55skidoo
Published on 2010-04-21T12:35:16Z Indexed on 2010/04/21 12:53 UTC
Read the original article Hit count: 428

I'm trying to strip content titles out of the middle of text strings. Could I use regex to strip everything out of this string except for the title (in italics) in these strings? Or is there a better way?

Joe User wrote a blog post called The 10 Best Regex Expressions in the category Regex.

Jane User wrote a blog post called Regex is Hard! in the category TechProblems.

I've tried to come up with a regex expression to cover this, but I think it might need two. The trick is that the text in bold is always the same, so you could search for that, like this:

regex: delete everything before and including wrote a blog post called

regex: delete in the category and everything after it.

© Stack Overflow or respective owner

Related posts about regex

Related posts about string-manipulation