Initial work

I used nose for testing and followed a much more TDD workflow than I usually do.

Test coverage is very good! On the flip side, I don't know if this actually works yet :)
Not sure why you're declaring this as `global` here? You're not changing the regex, just accessing it within the function, which can be done without `global`.