regex needed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
billyhoward
Forum Newbie
Posts: 1
Joined: Fri Jan 01, 2010 6:41 pm

regex needed

Post by billyhoward »

Hi All,

I need the regex that will get out the following links from a html page.

http://rapidshare.com/files/321406832/M ... res_pn.mp3
http://www.megaupload.com/?d=BCVJM9HS

the only bit thats not unique and thus matchable is really the domain name. the rest of it will obviously change on each post im looking at as this is getting links from a forum and then checking links for a personal project of mine.

They do vary alot on page to page a couple of obviouse things like not all users will put "www." and some will - same with http://. in this particular post there are only two domains, in others there are more but i have a list of domains i can add to the regex if its easy enough.

There will also a lot of the time be 10+ of the above links but i guess preg_match_all will resovle that!

Thanks very much!

Billy
Post Reply