As I don't know what those urls and links are going to be, I know I need to find everything from the opening <a to the closing </a> tag and ignore everything else.
This is the first time I've attempted a real regular expression and I'm totally stuck! I found the following expression which is supposed to achieve what I want, but implementing it seems to be another thing altogether!
<a href="[^"]+">[^<]+</a>
I've tried escaping the double quotes in the expression so that it doesn't get confused by the double quotes containing the expression when I use it in preg_match, but then I get the following error:
Warning: Unknown modifier '[' in /home/httpd/html/newstaffintranet/index.php on line 93
Line 93
Code: Select all
$urls = preg_match("<a href="ї^"]+">ї^<]+</a>", $news);So what am I doing wrong this time?
Thanks