fix regex match error

when using parts[0], I got an error::

    TypeError: '_sre.SRE_Match' object has no attribute '__getitem__'

So, I check the document, find that it should use group function: 
    https://docs.python.org/2/library/re.html#match-objects