Re: [PHP] Regex Masters: Please inspect this regex- Pulling urls out of page

2001-03-08 Thread Christian Reiniger
On Thursday 08 March 2001 09:19, you wrote: > I'm putting together a regex to pull all of the urls out of a web page. > Not the href tag, but just the url part of that tag. > > Here's what I've come up with: > > preg_match_all('/<.*href\s*=\s*(\"|\')?(.*?)(\s|\"|\'|>)/i', $html, > $matches); > for

[PHP] Regex Masters: Please inspect this regex- Pulling urls out of page

2001-03-07 Thread Matt Friedman
I'm putting together a regex to pull all of the urls out of a web page. Not the href tag, but just the url part of that tag. Here's what I've come up with: preg_match_all('/<.*href\s*=\s*(\"|\')?(.*?)(\s|\"|\'|>)/i', $html, $matches); foreach($matches[2] as $m) print "$m\n"; All regex masters p