LPM: Regexps for email.
0x29A [B.Vandgrift]
booberry at io.com
Wed Jan 26 10:09:01 CST 2000
I'm working on a script which goes through a link library I have and
throws down mad links. I'm having a problem with my email nonsense.
ideally, I'd like this bit of the program to take something like:
--
here is an email address:booberry at io.com
--
and turn it into:
--
here is an email address:<a
href="mailto:booberry at io.com">booberry at io.com</a>
--
I am using the following rexexp:
$inline =~ s/\b(\w+\@\w+(\.\w+)*\.\w+)\b/<a href=\"mailto:$1\">$1<\/a>/g;
The problem is, it continues matching on the line. Hence, I get three
nested requests. Cool, but not useful. How can I tell the regexp engine
not to attempt a match on the text that it just inserted?
Suggestions, comments, etc? They'd all be greatly appreciated.
Thanks
--
Ben Vandgrift <booberry at io.com> http://www.io.com/~booberry
________________________________________________________________________
"I do not feel obliged to believe that the same God who has endowed us
with sense, reason, and intellect has inteded for us to forego their
use." --Galileo
More information about the Lexington-pm
mailing list