I'm trying to match a html table my string contains more than one table so it's matching the beginning of the first ot the end of the last. This is what I have so far....
<table>.*</table>
I need to know how to negate a word(in this case "</table>") from the .* part.
TIA
With preg_match, you can do:
preg_match_all("/<table>(.*?)<\/table>/", $text, $match_array);
The question mark after the * makes the modifier un-greedy, which means it only matches as much as it needs to, no more. Hope that helps!
Chris King
many thanks, that's done the job.