← Back to team overview

openerp-community-reviewer team mailing list archive

Re: [Merge] lp:~hirt/ocb-addons/6.1_fix_mailaddress-parsing into lp:ocb-addons/6.1

 

Dear Stefan,

Sorry for the delayed continuation. Still the approach with getaddresses is not perfect. See below where the name 'bla@xxxxx' is converted into a funny emailaddress. However, it works sufficiently to replace the regexp. Will upload the update for your review. 
You might have a better proposal to get the second column of the matrix.

Thanks

Etienne

text = "'bla@xxxxx' <bla@xxxxx>, (bla@xxxxx) <bla@xxxxx>, \"'bla@xxxxx'\" <bla@xxxxx>,"
getaddresses([text])
[('', "'bla@xxxxx'"), ('', 'bla@xxxxx'), (' (bla@xxxxx)', 'bla@xxxxx'), ("'bla@xxxxx'", 'bla@xxxxx')]

re.findall(r'([^ ,(\'"<@]+@[^> ,)\'"]+)',text)
['bla@xxxxx', 'bla@xxxxx', 'bla@xxxxx', 'bla@xxxxx', 'bla@xxxxx', 'bla@xxxxx']



-- 
https://code.launchpad.net/~hirt/ocb-addons/6.1_fix_mailaddress-parsing/+merge/194030
Your team OpenERP Community Backports Team is subscribed to branch lp:ocb-addons/6.1.


References