import reregex = r"(?<=\b)\d+(?=[\s.,])"test_str = "Hi I am sony. My age 23. This is my email id sony.1510@gmail.com . Hi I am Jessey. My age 20. This is my email id jessey.1996@gmail.com . Hi I am ronald.My age 17 My mail id is ronald.1999@gmail.com" matches = re.finditer(regex, test_str, re.MULTILINE) for match in matches: print(match.group(0))
Standard input is empty
23 20 17
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!