I am trying to get the address of the sender in mbox formated mails in python. When I get the line that contains the sender, it looks like From: Mister X <misterx@domain>. I am able to retrieve the mail address with, for example, re.findall('<[a-zA-Z0-9\.]+@[a-zA-Z0-9\.]+>', str). I think that should be fine since email addresses, as far as I know, cannot contain any other characters. What I do not understand is why the expression <*@*>, which I expected to match any characters in the email address does not work at all. In fact, re.findall('<*@*>', 'From: Mister X <misterx@domain>')returns ['>'].
<* means: "the character < zero or more times". You are looking for <.*@.*>
Matching address in mbox format in python