Forum Moderators: coopster

Message Too Old, No Replies

help with regex

findind urls in an html page

         

Anguz

12:24 am on Sep 14, 2003 (gmt 0)

10+ Year Member


what would be the regular expression used to find urls in img or anchor tags in an html page?

MonkeeSage

3:11 am on Sep 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not a PHP user but this is correct for Perl and JavaScript, and as far as I understand PHP uses the same syntax for regular expressions...

/https?:\/\/([^"\s\0]+)/gi

...I'm not certain but I think something like this might be what you want...

preg_match(/https?:\/\/([^"\s\0]+)/gi, $arr);

Jordan

Anguz

4:06 am on Sep 14, 2003 (gmt 0)

10+ Year Member


thank you! =)