May 2014
Beginner
1312 pages
38h 36m
English
“Nothing is so obvious that it’s obvious . . . The use of the word ‘obvious’ indicates the absence of a logical argument.”
—Errol Morris
This chapter is mostly about extracting information from text. We store lots of our knowledge as words in documents, such as books, email messages, or “printed” tables, just to later have to extract it into some form that is more useful for computation. Here, we review the standard library facilities most used in text processing: strings, iostreams, and maps. Then, we introduce regular expressions (regexs) as a way of expressing patterns in text. Finally, we show how to use regular expressions to find and extract specific data elements, such as ZIP codes (postal codes), from text and to ...