Expand replacement text if regular expression.
(self, m, repl)
| 107 | self.do_find(False) |
| 108 | |
| 109 | def _replace_expand(self, m, repl): |
| 110 | "Expand replacement text if regular expression." |
| 111 | if self.engine.isre(): |
| 112 | try: |
| 113 | new = m.expand(repl) |
| 114 | except re.PatternError: |
| 115 | self.engine.report_error(repl, 'Invalid Replace Expression') |
| 116 | new = None |
| 117 | else: |
| 118 | new = repl |
| 119 | |
| 120 | return new |
| 121 | |
| 122 | def replace_all(self, event=None): |
| 123 | """Handle the Replace All button. |
no test coverage detected