What's wrong with my regular expression?
| From: | Ns_Andy | Date: | Mon, 14 Oct 2002 11:40:15 +0000 |
| Subject: | What's wrong with my regular expression? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-119865@lists.php.net to get a copy of this message | ||
$line = '<a href="http://www.yahoo.com">http://www.yahoo.com</a>';
if (eregi("<a[ ]+(.*[
]+)?href=([\"'])?([^<>\"'])+([\"'])?>[^<>]+<\/a[
]*>",$line,$matches)) {
print (htmlspecialchars($matches[0]));
}
it works fine,
however if
$line .= 'X<a href=http:/www.php.net>www.php.net</a>';
is added before eregi,
it doesn't,what's wrong with my code?
--
Regards,