LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] regexp / php question

[ILUG] regexp / php question

Stephen Reilly leydar at gmail.com
Thu Aug 18 09:27:50 IST 2005


On 17/08/05, Brian Foster <blf at blf.utvinternet.ie> wrote:
> > From: Stephen Reilly <leydar at gmail.com>
> > 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
>  obvious minor mistake — assuming John is trying
>  to generate HTML — it is </a> not <\a>.
Nuts, indeed, foreward slash, well spotted. 

>  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.
Well the other bits could be liberated a bit more if I had the
patience to google for email validating regular expressions/rules
which no doubt are there in abundance :) Email harvester traps and
honeypots notwithstanding people often obscure their email addresses
swapping "." with "dot" and so on (my really obscured but functional
mailto is below). From what he said I'd imagine the sed statement will
suffice. I've already started winding up awk just in case of
complications and am currently waiting for it to reach full power. The
lights have already started to dim so it shouldn't be long now..

Regards,
Stephen

obfuscated mail straightens itself out in a browser: <a
href="&#109;&#97;&#105;&#108;&#116;&#111;:&#x73;&#x74;&#x65;&#112;&#104;&#x65;&#110;&#x40;&#x68;&#x6B;&#99;&#46;&#x69;&#x65;?subject=&#x74;&#x69;&#116;&#108;&#x65;"
title="&#x72;&#111;&#x6C;&#x6C;&#111;&#x76;&#101;&#114;">&#108;&#x69;&#x6E;&#107;</a>


More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell