php preg_match pattern to extract a specific information, regex
- by Michael
I need to extract a specific Id from a html document but the problem is that the id must not "be used".
Here is the html content
http://pastebin.com/wF2dx8JZ
As you may see there are different html blocks . Some of them contain the "Used" word so I need to extract only the first id which is not used.
Basically I can write a simple pattern like :
$pattern = "/javascript:tw(.*))/";
preg_match_all($pattern, $content, $matches);
$id = $matches[1][0];
However in this case I'm also getting the "ids" which are used so I don't know how to exclude them from the equation . Any idea would be highly appreciated.