A motivating example
Suppose you want to find all quotes in a document
- Quotes follow a pattern: a double quote, some text, and another double quote
x=re.findall('(?m)\".+?\"', articles[1])
print(x)
## ['"Anna Karenina"', '"All happy families are alike."', '"Why two more now, and in the same year? I have no idea,"', '"The Decameron,"', '"The Iliad"', '"The Odyssey"', '"I thought I could do better,"', '"The Decameron"', '"naked from the waist down."', '"naked from the waist up."', '"I would be happy to address this question if you allow me to go over Wayne\'s edition and find some mistakes that he can address,"', '"Each new translation profits from those that went before,"', '"I am sure that Wayne took a look at our version, especially since we tried to take a nonarchaic, non-British approach to Boccaccio\'s great and very clear vernacular Italian."', '"Anna Karenina,"', '"perfectionist,"', '"spats,"', '"an example of where she was off the mark."', '"brogues,"', '"smart shoes with perforations."', '"light peasant moccasins."', '"moccasin"', '"It\'s a loaded word, particularly in the U.S.,"', '"Most disagreements over words ignore the context, which is all important,"', '"porshni,"', '"is obsolete in Russian,"', '"primitive peasant shoes made from raw leather."', '"rather close to the first meaning of brogues in the Oxford English Dictionary: \'rough shoes of untanned hide.\' "', '"will be a long time before I get those."', '"we want to have a 21st-century translation with a critically up-to-date introduction and notes."', '"The Death of Ivan Ilyich & Confession."', '"He consciously chose to spend the last year of his life translating this book,"', '"The Tale of Genji,"', '"There\'s always room for another excellent translation,"']