Gruber's regex in Python

Used the implementation at http://stackoverflow.com/a/1986151