638 regexp += "{0}-{1}".format( |
638 regexp += "{0}-{1}".format( |
639 self.__formatCharacter(char1, format), |
639 self.__formatCharacter(char1, format), |
640 self.__formatCharacter(char2, format)) |
640 self.__formatCharacter(char2, format)) |
641 |
641 |
642 if regexp: |
642 if regexp: |
643 if regexp.startswith("\\") and regexp.count("\\") == 1 and "-" not in regexp: |
643 if (regexp.startswith("\\") and \ |
|
644 regexp.count("\\") == 1 and \ |
|
645 "-" not in regexp) or \ |
|
646 len(regexp) == 1: |
644 return regexp |
647 return regexp |
645 else: |
648 else: |
646 return "[{0}]".format(regexp) |
649 return "[{0}]".format(regexp) |
647 else: |
650 else: |
648 return "" |
651 return "" |