Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardCharactersDialog.py

branch
Py2 comp.
changeset 2791
a9577f248f04
parent 2525
8b507a9a2d40
parent 2733
0c4c648a93b3
child 2847
1843ef6e2656
--- a/Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardCharactersDialog.py	Mon Jul 08 21:47:26 2013 +0200
+++ b/Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardCharactersDialog.py	Mon Jul 08 22:36:10 2013 +0200
@@ -640,7 +640,10 @@
                 self.__formatCharacter(char2, format))
         
         if regexp:
-            if regexp.startswith("\\") and regexp.count("\\") == 1 and "-" not in regexp:
+            if (regexp.startswith("\\") and \
+                regexp.count("\\") == 1 and \
+                "-" not in regexp) or \
+               len(regexp) == 1:
                 return regexp
             else:
                 return "[{0}]".format(regexp)

eric ide

mercurial