RE: [PHP] [RegExp] extracting anchors
| From: | Boaz Yahav | Date: | Thu, 13 Mar 2003 20:39:34 +0000 |
| Subject: | RE: [PHP] [RegExp] extracting anchors | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-139590@lists.php.net to get a copy of this message | ||
Try these two :
A function that parses a string and replaces http://whatever with a
link, and email addresses with a mailto link.
This function was designed for the motd package. But will work freely on
its own.
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1235
How to change all of the links in a string to be HTML links.
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1567
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: Jens Lehmann [mailto:jens.lehmann@goldmail.de]
Sent: Wednesday, March 12, 2003 11:08 PM
To: php-general@lists.php.net
Subject: [PHP] [RegExp] extracting anchors
Hello,
I want to extract the "name"-attribute of all anchors out of an
HTML-source-code which don't have the "href"-attribute. I can use this
code to get the "name"-attribute:
preg_match_all('/<a([^>]*?)name=[ \'\"](.*?)[
\'\"](.*?)>/is',$src,$ar);
The name-attributes are now in $ar[2]. How can I exclude all links which
have the href-attribute? I didn't find an easy way how to say that a
string must _not_ be part of a pattern match. I hope you can give me
some advise.
Jens
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php