Updated exceptions for python 3. Add try/except for the re command.