import rep = re.compile(r"\w+(?:'\w+)*|[^\w\s]")s = "There is light!? I'm a human"print(p.findall(s))
Standard input is empty
['There', 'is', 'light', '!', '?', "I'm", 'a', 'human']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!