A regexp object has no .startswith() method, which caused an unnecessary try/except block to be added to handle this.