January 2011
Intermediate to advanced
224 pages
5h 43m
English
Now let’s look at a real problem that calls for regular expressions. Imagine we are writing a program to automatically harvest information about our enemies from the Internet. We will not actually write such a program here, just the part that reads the configuration file. This file looks like this:
searchengine=http://www.google.com/search?q=$1 spitefulness=9.7 ; comments are preceded by a semicolon... ; these are sections, concerning individual enemies [larry] fullname=Larry Doe type=kindergarten bully website=http://www.geocities.com/CapeCanaveral/11451 [gargamel] fullname=Gargamel type=evil sorcerer outputdir=/home/marijn/enemies/gargamel
The exact rules for this format (which is actually a widely used format, usually called ...