Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardCharactersDialog.py

branch
Py2 comp.
changeset 2791
a9577f248f04
parent 2525
8b507a9a2d40
parent 2733
0c4c648a93b3
child 2847
1843ef6e2656
equal deleted inserted replaced
2790:6686a3326df8 2791:a9577f248f04
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 ""

eric ide

mercurial