Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardCharactersDialog.py

changeset 2733
0c4c648a93b3
parent 2302
f29e9405c851
child 2791
a9577f248f04
child 2824
858412c29c34
equal deleted inserted replaced
2732:c14fe50c113e 2733:0c4c648a93b3
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 ""

eric ide

mercurial