kaancho12
Technical User
- Feb 22, 2005
- 191
hi,
i am trying to use php's preg_match to get elements inside certain HTML tags and i was wondering if anybody can help me figure this out.
I am trying to match all the links that have this pattern:
<A HREF="/ABC/specs/1thru10/ABC10.html">10</A>
When carrying out preg_match I am able to match them but is there a way to add more to the data "10" that's in between the HTML tags?????? I first have to refer to it but I cant seem to do that even.
here's my code:
if (preg_match("/(<A HREF=\/ABC\/specs\/[a-z][0-9][a-z]\/[a-z][0-9]\.[a-z]\/>)*?(<\/a>)/","<A HREF=\"/ABC/specs/1thru10/ABC10.html\">10</a>", $matches)){
echo $matches[0];
}
i am trying to use php's preg_match to get elements inside certain HTML tags and i was wondering if anybody can help me figure this out.
I am trying to match all the links that have this pattern:
<A HREF="/ABC/specs/1thru10/ABC10.html">10</A>
When carrying out preg_match I am able to match them but is there a way to add more to the data "10" that's in between the HTML tags?????? I first have to refer to it but I cant seem to do that even.
here's my code:
if (preg_match("/(<A HREF=\/ABC\/specs\/[a-z][0-9][a-z]\/[a-z][0-9]\.[a-z]\/>)*?(<\/a>)/","<A HREF=\"/ABC/specs/1thru10/ABC10.html\">10</a>", $matches)){
echo $matches[0];
}