import retext = "(30123:424302) 123 #4324:#34123"print(re.findall(r"(?<![#\d])\d+", text))
Standard input is empty
['30123', '424302', '123']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!