using the buton 'add friend' from the title bar. some contacts have this format: 'UID:195\r', 'TEL;TYPE=CELL;TYPE=WORK:+32477000000\r', 'X-SIP:203\r', 'X-MSN;X-OSSO-VALID=yes;TYPE="msn-pecan":msn blabla 'FN:name' TEL is before FN CELL is before work Code: numbers = re.findall("TEL;TYPE=.*?CELL.*?:(.[0-9]*)\r\n", contact) fixes the problem
numbers = re.findall("TEL;TYPE=.*?CELL.*?:(.[0-9]*)\r\n", contact)