import rep = re.compile(r'(?<!-)\b\d+\b(?!-)')s = "2016-03-29\n7\n46\n8\n43\n9\n47"print(p.findall(s))
Standard input is empty
['7', '46', '8', '43', '9', '47']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!