deleted debug lines and added a print of problems when matching regex