Re: regular expressions

From: Date: Wed, 14 Jun 2000 19:39:06 +0000
Subject: Re: regular expressions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-1863@lists.php.net to get a copy of this message
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

« previous php.general (#1863) next »