319 if wo: |
319 if wo: |
320 txt = "\\b%s\\b" % txt |
320 txt = "\\b%s\\b" % txt |
321 flags = re.UNICODE | re.LOCALE |
321 flags = re.UNICODE | re.LOCALE |
322 if not cs: |
322 if not cs: |
323 flags |= re.IGNORECASE |
323 flags |= re.IGNORECASE |
324 search = re.compile(txt, flags) |
324 try: |
|
325 search = re.compile(txt, flags) |
|
326 except re.error, why: |
|
327 QMessageBox.critical(None, |
|
328 self.trUtf8("Invalid search expression"), |
|
329 self.trUtf8("""<p>The search expression is not valid.</p>""" |
|
330 """<p>Error: {0}</p>""").format(unicode(why))) |
|
331 self.stopButton.setEnabled(False) |
|
332 self.findButton.setEnabled(True) |
|
333 self.findButton.setDefault(True) |
|
334 return |
|
335 |
325 |
336 |
326 # reset the findtextCombo |
337 # reset the findtextCombo |
327 if ct in self.searchHistory: |
338 if ct in self.searchHistory: |
328 self.searchHistory.remove(ct) |
339 self.searchHistory.remove(ct) |
329 self.searchHistory.insert(0, ct) |
340 self.searchHistory.insert(0, ct) |