fixed regex parsing, added matches operator and made comments PEP8 compatible