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