RE: [PHP-GENERAL] regular expressions

From: Date: Wed, 14 Jun 2000 21:30:27 +0000
Subject: RE: [PHP-GENERAL] regular expressions
Groups: php.general 
Request: Send a blank email to php-general+get-1868@lists.php.net to get a copy of this message
Check out : How to use regular expressions to get the list of links from an HTML page : http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1401 berber http://www.weberdev.com -----Original Message----- From: Victor [mailto:victord@wwcd.com] Sent: Wednesday, June 14, 2000 9:39 PM To: PHP Digest Mailing List Subject: Re: [PHP-GENERAL] regular expressions Well, taking what Zak said, I guess you can try getting rid of .* or .+ alltogether, but that means tradeoffs. If you know what text will be acting as a link, here are a couple possiblities that might work eregi("<li><a href=\"http://([^\"]+)">([0-9a-zA-Z- ]+)</a>",$myLine,$temp); eregi("<li><a href=\"http://([^\"]+)">([^<]+)</a>",$myLine,$temp); Both have problems: the first one will only match digits,letters,space, and dash. Second one will be thrown off if you have "<" somewhere in text that acts as a link. HTH Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#1868) next »