Hi im trying to use regular expression to pull out links from a pice of html as follows:
<p>some random text < hr ef="http://url.co.uk/link/">link text</a> some more random text.</p>
The reg expression I am using is:
preg_match_all('/(< href="http:\/\/url.co.uk\/([\d\D]*?)\/">([\d\D]*?)<\/a>)/', $content, $matches);
Which works fine until part of the link has a carrage return in the middle of it due to a line wrap as follows:
<p>some random text < href="
http://url.co.uk/link/">link text</a> some more random text.</p>
The carrage return can be anywhere within the link and means that the link doesn't get matched.
Can anyone suggest a way out of this either buy tightning up the reg expression or by doing something to remove the carrage return befor the reg expression acts on the text.