I wanted to get rid of the regex but the alternative of parsing the attribute string manually was slower and more complicated.
Moved the regular expressions to the top of the file to avoid recompiling them each time the function is called. Ran it against the hotshot profiler and it was too slow for my liking. Also split them up to make it more readable.
Fixes #74: Regex to quote keys no longer messes with attribute values…
…. Also, precompiling regex for speed and readability
(#74). Small typo