654 regexp += "{0}-{1}".format( |
654 regexp += "{0}-{1}".format( |
655 self.__formatCharacter(char1, format), |
655 self.__formatCharacter(char1, format), |
656 self.__formatCharacter(char2, format)) |
656 self.__formatCharacter(char2, format)) |
657 |
657 |
658 if regexp: |
658 if regexp: |
659 if (regexp.startswith("\\") and \ |
659 if (regexp.startswith("\\") and |
660 regexp.count("\\") == 1 and \ |
660 regexp.count("\\") == 1 and |
661 "-" not in regexp) or \ |
661 "-" not in regexp) or \ |
662 len(regexp) == 1: |
662 len(regexp) == 1: |
663 return regexp |
663 return regexp |
664 else: |
664 else: |
665 return "[{0}]".format(regexp) |
665 return "[{0}]".format(regexp) |