Can anyone help me with PHP regex (Regular Expression). I want to get all URLs that matches a certain attribute. The following example is, I want to get all href URLs that has a class of 'foo'.
<a title="foo" href="http://foo.com/" class="foo">Foo</a>
<a href="http://bar.com/" class="bar">Bar</a>
<a class="foo" title="foobar" href="http://foobar.com/">FooBar</a>
Result should be match the 2 URLs:
http://foo.com/
http://foobar.com/
I know this can be done easily using PHP packages such as DOM crawlers, but I want to use PHP RegEx.