adjusted regex groups live with python3, fixes #786

tested on python 2.7.5+ and 3.3.2+