9.2 Search and Replace Function
A powerful way to make modifications to a MIB file is searching and replacing by regular expressions.
To search a MIB file by a regular expression, choose
from the Edit menu. Enter the expression to search for in the opened dialog. The combo box will remember ten expressions used last.
To search and replace found matches, choose
from the Edit menu. Enter the search expression and the substitution expression and press . A matched region in the MIB file will be selected and a confirmation dialog will be shown. Each substitution can be confirmed individually or all substitutions can be confirmed at once.
The substitution string may contain variable interpolations referring to the saved parenthesized groups of the search pattern. A variable interpolation is denoted by $1, or $2, or $3, etc. It is easiest to explain what an interpolated variable does by giving an example:
Suppose you have the pattern b\d+: and you want to substitute the b's for a's and the colon for a dash in parts of your input matching the pattern. You can do this by changing the pattern to b(\d+): and using the substitution expression a$1-. When a substitution is made, the $1 means „Substitute whatever was matched by the first saved group of the matching pattern“. An input of b123: after substitution would yield a result of a123-.