import re text = "She's so nice!"matches = re.findall(r'[A-Za-z]+|[^A-Za-z ]', text) print(matches)
Standard input is empty
['She', "'", 's', 'so', 'nice', '!']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!