5 # Parses country list from
6 # http://en.wikipedia.org/w/index.php?title=List_of_IOC_country_codes&action=edit
13 ( [A-Z]{3} ) # country code
16 ( ?: .*? \| ) ? # optional article lookup
17 ( .*? ) # country name
21 my ($countrycode, $countryname) = ($1, $2);
23 # fix some wikisyntax ickyness :-)
24 $countryname =~ s/\]\]//g;
25 $countryname =~ s/\[\[//g;
27 # minimal SQL escaping
28 $countryname =~ s/'/\\'/g;
30 printf "INSERT INTO countries (countryname,countrycode) VALUES ('%s','%s');\n",
31 $countryname, $countrycode;