648 flags.append("re.ASCII") |
648 flags.append("re.ASCII") |
649 flags = " | ".join(flags) |
649 flags = " | ".join(flags) |
650 |
650 |
651 code = "" |
651 code = "" |
652 if self.importCheckBox.isChecked(): |
652 if self.importCheckBox.isChecked(): |
653 code += "import re{0}{1}".format(os.linesep, istring) |
653 code += "import re{0}{0}{1}".format(os.linesep, istring) |
654 code += "{0} = re.compile(".format(reVar) |
654 code += "{0} = re.compile(".format(reVar) |
655 code += '{0}{1}r"""{2}"""'.format( |
655 code += '{0}{1}r"""{2}"""'.format( |
656 os.linesep, i1string, regexp.replace('"', '\\"') |
656 os.linesep, i1string, regexp.replace('"', '\\"') |
657 ) |
657 ) |
658 if flags: |
658 if flags: |
659 code += ",{0}{1}{2}".format(os.linesep, i1string, flags) |
659 code += ",{0}{1}{2}".format(os.linesep, i1string, flags) |
660 code += "{0}){0}".format(estring) |
660 code += ",{0}){0}".format(estring) |
661 return code |
661 return code |
662 |
662 |
663 |
663 |
664 class PyRegExpWizardDialog(QDialog): |
664 class PyRegExpWizardDialog(QDialog): |
665 """ |
665 """ |