import restring = "this is 'a sentence' with less 'than twenty words'"result = re.findall("'(.*?)'", string)print result
Standard input is empty
['a sentence', 'than twenty words']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!