Extract a string between double quotes

Provided there are no nested quotes:

re.findall(r'"([^"]*)"', inputString)

Demo:

>>> import re
>>> inputString = 'According to some, dreams express "profound aspects of personality" (Foulkes 184), though others disagree.'
>>> re.findall(r'"([^"]*)"', inputString)
['profound aspects of personality']

Leave a Comment