| Date: Wed, 17 Aug 2005 16:39:08 +0100
| From: Stephen Reilly <leydar at gmail.com>
| On 17/08/05, John P. Looney <valen at tuatha.org> wrote:
| > Ah. I should have pointed out that the name and email can change
| > on each line.
| Perhaps something along the lines of:
| sed "s#'\([a-zA-Z0-9-_.]*\)' <\(\([a-zA-Z0-9-_.]*\)@[a-zA-Z0-9-_]*\.[a-zA-Z0-9-_]*\)>#\<a href='thing?\1'\>\1\<\\a\> \<a href='mailto:\2'\>mail \3\<\\a\>#g" filename
| It will replace:
| send an email to 'Looney' <email at domain.com> and tell him about it.
| send an email to <a href='thing?Looney'>Looney<\a> <a href='mailto:email at domain.com'>mail email<\a> and tell him about it.
obvious minor mistake — assuming John is trying
to generate HTML — it is </a> not <\a>.
not knowing exactly what John's input is like,
I wonder if having such specific REs is a good
idea; e.g., if '\([^']*\)' or similar would
be better for the Looney part? and likewise for
the other bits, which are left as an exercise
for the reader.
Experienced (20+ yrs) kernel/software Eng: | Brian Foster Montpellier,
• Unix, embedded, &tc; • Linux; • doc; | blf at utvinternet.ie FRANCE
• IDL, automated testing, process, &tc. | Stop E$$o (ExxonMobile)!
Résumé (CV) http://www.blf.utvinternet.ie | http://www.stopesso.com
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!