RSS

 
WinEdt Macro Library  | text previous macro  | next macro

envReplace

Description

This macro replaces strings in a specified environment only.

If, e.g., you want to replace all instances of "a" to "\alpha" in a math environment, you can use this macro. It will leave all "a"s that are outside the specified environment in peace.

You have to specify the environment, in which you want the replacement to take place, and the find and replace strings.
The environment has to be put in terms of WinEdt's Regular Expression.
That means you have to escape the following characters with a "\" , if you want their literate meaning:

 $ \ < > [ ] { } ? . * + @ ~ | ^

Examples of environments are: "\$*\$"  or  "\\\[*\\\]".
The find and replace strings are normal strings.

Installation

Put the macro in %b\Macros\text\. If you want you can assign a shortcut to it.

Download

text/envReplace.edt

Macro contributed by Robert <w.m.lgmx.net>.

WinEdt Macro Library  | text previous macro  | next macro