I have an html file where I’d like to get all the text inside these two tags:
<div class="articleTitle">
</div>
I’m not entirely sure how to do the php regex.
(I also know there are no html tags inside the div, so there’s no problem about nested tags)
update: when i try the solutions given i get this: Warning: preg_match() [function.preg-match]: Unknown modifier ‘d’ on line 29
This is the “Explination” from RegexBuddy:
(.*?) will capture everything between what comes before it until what comes after it, and it will be places into the $matches var.
I assumed that the HTML will be in the $source var.
I suggest that you look into RegexBuddy, it’s 39.95 (USD) but it is worth every penny. It can help build your RegExs with most every major RegEx implementation, and it can help you to learn RegEx