Image

hi! i'm still not sure if it's appropriate to ask questions here, but i'm going to go ahead.. i'm pulling page content from a database and one of the things i would like to do is make a function to look for e-mail addresses and web sites and build <a> tags for them on the fly. so, for example, if there's a line in the database reading:

Email you@yourdomain.com for more info.

I want this function to write it to the final html page like:

Email <a href="mailto:you@yourdomain.com">you@yourdomain.com</a> for more info.

i certainly could work through the regex given enough time, but it seems like this should be a common enough thing, so i was hoping someone could point me in the direction of a code snippet i could use—i mean, who wants to reinvent the wheel?

if i get anywhere with this, i'll of course post the solution. thanks in advance!