i have this html code i need to download all doc file how can i build regular expression to find this links: for example i need to receive this link : http://skatc.com/resume/Resume%2520-%2520Sarah%2520Collins.doc <div id="res"><div id="topstuff"></div><div id="search"><div id="ires"><ol><li class="g"><span style="float:right"><span dir="ltr" class="mime">[DOC]</span> </span><h3 class="r"><a dir="ltr" href="/url?q=http://skatc.com/resume/Resume%2520-%2520Sarah%2520Collins.doc&sa=U&ei=HGGNVa65Jsb9Uqbuk6AB&ved=0CBcQFjAA&usg=AFQjCNEivjreEwg-JFI5buWcIHmqPwRr4g"><b>Resume</b> of Sarah Collins, <b>Web Developer</b></a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite><span dir="ltr">skatc.com/<b>resume</b>/<b HTML:
Depends. Is this code you have direct access to? If so, you shouldn't really need a reger, you should be able to parse the code using the built in dom functions of PHP. But, for a regular expression, you'd search for the url?q= and then just parse the url after and before &sa