Regular Expression Help Needed

David A McInnis david at dataovation.com
Sat Nov 17 01:02:17 EST 2001


But if the email address is enclosed in html, then it should be pretty easy
to snag, right.  Just pull out everything between <a href="mailto:  and ">.
Anyway, that is my understanding, but I don't know how to make it happen.  I
will go check out this book tomorrow.  Let me know if you have any other
thoughts.

David

-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Chris Tavares
Sent: Friday, November 16, 2001 7:00 PM
To: python-list at python.org
Subject: Re: Regular Expression Help Needed


"David A McInnis" <david at dataovation.com> wrote in message
news:mailman.1005960683.29958.python-list at python.org...
> Ok, I am not very good at regular expressions, so any help is greatly
> appreciated.
>
> Here is the situation.
>
> I have a database table that contains a text field.  This text field may
or
> may not contain email addresses.  I know how to read the content of field
to
> a string.  Now what I need is a regular expression that I could use to
> identify any email addresses in the string.  Since the email can be in
mixed
> case, I need a solution that is case insensitive.
>
> So, there may be one or more email addresses in the string.  When I find
> one, I need to added it to a list variable and look for other addresses in
> the string.
>
> Thanks,
>
> David McInnis
>

Get a copy of _Mastering Regular Expressions_, by Jeffrey Friedl, from
O'Reilly press. The regular expression you want is in the back.

Be warned - it's over 4000 characters long, and it still doesn't work in all
cases. Email addresses are not a regular language, and therefore cannot be
completely matched by regular expressions.

-Chris




--
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list