This one works.
import re
data = "(AVP:SMTP/xx@xx.xx) R:AVP:SMS.0/+44648474 id:24"
data2 = "(AVP:SMTP/<xxx@xx.xx>) R:AVP:FAX.0/<thisword> id:25"
regex = re.compile(r"/<?([^>\s\)]+)")
print regex.findall(data)
print regex.findall(data2)
>>>
['xx@xx.xx', '+44648474']
['xxx@xx.xx', 'thisword']
This regex breakdown:
/
: the/
character.<?
: optionaly a<
character.(
: start capture group.[^>\s\)]+
: capture anything that is not>
,\s
(whitespace), or)
.)
: close capture group.