I\'m trying to find eveything inside a div using regexp. I\'m aware that there probably is a smarter way to do this - but I\'ve chosen regexp.
so currently my regexp
What about something like this :
$str = <<text to extract here
Note the '?' in the regex, so it is "not greedy".
Which will get you :
array
0 => string 'text to extract here' (length=20)
1 => string 'text to extract from here as well' (length=33)
This should work fine... If you don't have imbricated divs ; if you do... Well... actually : are you really sure you want to use rational expressions to parse HTML, which is quite not that rational itself ?