[EMAIL PROTECTED] wrote:
> Does it really need to be a regular expression? Why not just write a
> short function that breaks apart the input and validates each part?
>
> def IsEmail(addr):
> 'Returns True if addr appears to be a valid email address'
>
> # we don't allow stuff like [EMAIL PROT
[EMAIL PROTECTED] wrote:
> rbt> re.compile('([EMAIL PROTECTED])')
> rbt> re.compile(r'[EMAIL PROTECTED],4}')
> rbt> re.compile('(\S+)@(\S+)')
>
> rbt> All of these will find email addys, but they also find other
> rbt> things.
>
> I think the only way to decide if your regular
[EMAIL PROTECTED] wrote:
> Does it really need to be a regular expression? Why not just write a
> short function that breaks apart the input and validates each part?
>
> def IsEmail(addr):
> 'Returns True if addr appears to be a valid email address'
>
> # we don't allow stuff like [EMAIL PROT
Does it really need to be a regular expression? Why not just write a
short function that breaks apart the input and validates each part?
def IsEmail(addr):
'Returns True if addr appears to be a valid email address'
# we don't allow stuff like [EMAIL PROTECTED]@biff.com
if addr.count('@') !=
Jim wrote:
> There is a precise one in a Perl module, I believe.
> http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
> Can you swipe that?
>
> Jim
>
I can swipe it... but it causes my head to explode. I get unbalanced
paratheses errors when trying to make it work as a python re... it mak
* rbt wrote:
> Is it possible to write an re that _only_ matches email addresses?
No. The only way to check if the matched thing is a mail address is to send
a mail and ask the supposed receiver whether he got it.
The grammar in RFC 2822 nearly matches anything with an @ in it. So, how
accurate
Jim> http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
Maybe Cafe Express could be convinced to put that on a t-shirt...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
rbt> re.compile('([EMAIL PROTECTED])')
rbt> re.compile(r'[EMAIL PROTECTED],4}')
rbt> re.compile('(\S+)@(\S+)')
rbt> All of these will find email addys, but they also find other
rbt> things.
I think the only way to decide if your regular expression does what you want
is to pro
OMG, that is so ugly :D
Jim wrote:
> There is a precise one in a Perl module, I believe.
> http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
> Can you swipe that?
>
> Jim
>
>
--
http://mail.python.org/mailman/listinfo/python-list
There is a precise one in a Perl module, I believe.
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
Can you swipe that?
Jim
--
http://mail.python.org/mailman/listinfo/python-list
Is it possible to write an re that _only_ matches email addresses? I've
been googling around and have found several examples on the Web, but all
of them produce too many false positives... here are examples from
Google that I've experimented with:
re.compile('([EMAIL PROTECTED])')
re.compile(r'
11 matches
Mail list logo