import res = '+91 1234567890, 1234567790, 012345678900, 1234568901112, 01234567890'print(re.findall(r'(?<!\w)(?:(?:\+91|0)\s?)?\d{10}\b', s))
Standard input is empty
['+91 1234567890', '1234567790', '01234567890']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!