John P. Looney wrote:
>>$f=file('thefile.txt');
>>foreach($f as $ln){
>> $ln=str_replace(
>> array("'Looney'",'email at domain.com'),
>> array('<a href="thing?Looney">','a
>> href="mailto:email at domain.com"');
>>}
>>> Ah. I should have pointed out that the name and email can change on each
> line. That's the tricky bit. And I don't want just one thing replaced -
> i.e. if there is an email, without a name in quotes before it.
oh right. how about this:
$f=file('thefile.txt');
foreach($f as $ln){
$ln=preg_replace(
'/(\'([^\']*)\' <)?(([a-zA-Z0-9-]*)@
([a-zA-Z0-9-]*\.)+([a-zA-Z0-9-\.]*))/',
...er...
looks like you'll need to do it programmatically. Can't think how to do
that with a simple regexp
Kae
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!