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