You have two problems. First, when you capture title you're attempting to capture non-digits (e.g. /(\D+)/). The trouble is that whitespace also qualifies as non-digits. So you're creating empty titles from time to time, which explains the funny whitespace when printing out the blank keys. Try instead to capture only what you're looking for, i.e. characters that aren't digits, or /([A-Za-z]+)/.
Second you're printing out the hash, but really you want to map over the keys of the hash. Add the keyword keys in front of the hash to get the desired result, otherwise the map iterates over key, value, key, value, etc..