Hi,


I'm trying to filter out links from a webpage but list them at the bottom with this:

preg_replace('/href="([^"]+)"[^>]*>(.+?)<\/a>/ie','listPossibleLinks("\\1")', $html);

It works for <a href="index">bleh</a> but how would i write it that it would also work for single quotes: <a href='index'>bleh</a>

That's the first part.

For another function I need set a target="_blank" for all links in a given string. Some already have a target, some don't.

I suck at regex, reading all about it but just don't get it. Thanks for any help!