Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Regular Expression for email string

7 views
Skip to first unread message

Nicole

unread,
Mar 20, 2003, 10:47:28 AM3/20/03
to
I have a field that allows the entry of multiple e-mail addresses,
separated by a comma. My problem is that I need to come up with a
regular expression to properly display these addresses. The
expression I'm trying isn't working:

<cfset newemail = REReplace(#email#,
"(([[:alnum:]]_\.\-)+@([[:alnum:]]_\.\-)+[[:alnum:]]{2,4}])",
"<a href=""mailto:\1"">\1</a>",
"ALL")>

I'm not receiving any errors, but at the same time it doesn't seem to
be matching anything as it's simply outputting the e-mail addresses
(not as links).

Any help would be greatly appreciated!

Nicole

Andy J

unread,
Mar 21, 2003, 5:52:17 AM3/21/03
to
Check out this thread from the begining of the year
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&threadm
=BA56906C.E33%25mpwoodward%40hotmail.com&rnum=10&prev=/&frame=on (watch the
wrap)

Andy Jarrett
www.thebluefrogcompany.net

"Nicole" <n_nai...@yahoo.com> wrote in message
news:7ff4d271.03032...@posting.google.com...

Adam Cameron

unread,
Mar 21, 2003, 6:14:27 AM3/21/03
to
>(watch thewrap)

Andy... have a look at www.tinyurl.com.

Adam

Andy J

unread,
Mar 21, 2003, 7:16:30 AM3/21/03
to
What a god send!

Cheers Adam

Andy J


"Adam Cameron" <adam...@hotmail.com> wrote in message
news:mvsl7vcog1b212n3h...@4ax.com...

Nicole

unread,
Mar 21, 2003, 11:20:06 AM3/21/03
to
Thanks for you reply, Andy. After playing with this off and on, for
several days, I finally got the following to work:

<cfset newemail = REReplace("#email#",
"([[:space:]]*[,|;][[:space:]]*)", "<br>", "ALL">
<cfset mailto = REReplace("#newemail#",
"(([[:alnum:]_.-]*)?[[:alnum:]]?@[[:alnum:]_.]*[[:alpha:]]*)",

"<a href=""mailto:\1"">\1</a>",
"ALL")>

Maybe it will help someone else having the same problem.

Nicole

Jim Davis

unread,
Mar 21, 2003, 11:47:55 AM3/21/03
to

"Adam Cameron" <adam...@hotmail.com> wrote in message
news:mvsl7vcog1b212n3h...@4ax.com...

> >(watch thewrap)
>
> Andy... have a look at www.tinyurl.com.
>

Personally I'm on the fence about these services (tinyURL, MakeAShorterLink,
etc) - on one hand they do what they say (abstract a long link to a shorter
one) but on the other they are an abstraction - and a private one at that.

The issue is (using this case as an example) That Andy linked to the content
requested - and as long as that site (Google) stays up you can get to it.
But with a short-link service you're making the retrieval of the content
dependent upon the existence (and continued maintenance) of that service.

So, in the end I would suggest posting BOTH the long link (for archival
purposes) and the short link (for convienence).

I'm probably taking this too seriously but that's always been one of the
web's biggest problems: the 404 error due to moved or missing content. ;^)

Jim Davis
--
President, Depressed Press of Boston: http://www.DepressedPress.com/
Webmaster, First Night Boston: http://www.firstnight.org/
Senior Consultant, Metlife eCommerce IT: http://www.metlife.com/


Andy J

unread,
Mar 21, 2003, 12:37:13 PM3/21/03
to
Jim, just to help you sleep at night, and cut down on those "404 Page
missing" nightmares i'll ensure that if i ever use the "shortlink" i'll post
the original URL :o) :o)

Andy J
www.thebluefrogcompany.net

"Jim Davis" <newsm...@vboston.com> wrote in message
news:b5ffn...@enews1.newsguy.com...

Jim Davis

unread,
Mar 21, 2003, 5:14:21 PM3/21/03
to

"Andy J" <awjarrett[at]hotmail[dot]com> wrote in message
news:v7mjfas...@corp.supernews.com...


> Jim, just to help you sleep at night, and cut down on those "404 Page
> missing" nightmares i'll ensure that if i ever use the "shortlink" i'll
post
> the original URL :o) :o)

Ah, sweet release! Now all my worries are gone! ;^)

0 new messages