regex - Matching address in mbox format in python -
i trying address of sender in mbox formated mails in python. when line contains sender, looks from: mister x <misterx@domain>
. able retrieve mail address with, example, re.findall('<[a-za-z0-9\.]+@[a-za-z0-9\.]+>', str)
. think should fine since email addresses, far know, cannot contain other characters. not understand why expression <*@*>
, expected match characters in email address not work @ all. in fact, re.findall('<*@*>', 'from: mister x <misterx@domain>')
returns ['>']
.
<*
means: "the character < 0 or more times". looking <.*@.*>
Comments
Post a Comment