![]() |
|
/ |
Longname: | / | ![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Released: | not available | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Created: | not available | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See also: | kud |
Summary |
Invokes Arbortext APP's search and replace feature, either searching for text or, optionally, searching for text and replacing it with some other text. |
Example extract |
Search for any entry in the form \item[???] and replace with <item id=???>.
|
Syntax
|
search:b |
The text to search for. Special characters are entered by numeric value within two \ characters. Below are some examples:
Wildcards are entered as a ? character. If you are using wildcards you must also turn wildcards on by including a ? in the options parameter. For a full list see the 3B2 ISO character set User reference or Macro manual |
replace:b |
The string to replace the search text with. This takes the same format as the search parameter. If wildcards are turned on in the options parameters, a ? can be used to refer to the character that matched a ? in the search text. |
options:b |
|
Regular expressions |
Regular expressions are a powerful extension to the search and replace tool. There are many different operators used with the 'r' and 'r' options producing differing results for each one. Regular expression operators are discussed under Search and replace in the User Reference Manual Some useful examples are illustrated below. |
Example |
Regular expressions add a powerful extension to the conditional test macro see also Regular expressions_en. The examples below illustrate some of the many options available using regular expressions.
|
Example |
Remove the fig refs from an entry such as, ...<figr figref="1">see figure 1</figr>... leaving just the text between them: The syntax has been broken down into understanable sections below. This first section intructs Arbortext APP to search for <figr figref=", and then any character excluding a closing chevron >. The * means match the preceding regular expression as many times as possible before continuing with remainder of the pattern. Now search for any characters until you see an opening chevron < there could be many characters before the next open chevron so the * is again present to repeat this search. The parenthesis are there to indicate this is a group that will be used later for the replacement text. Replace the searched text with the result found in group 1.
|
Example |
The search and replace macro shown below uses several of these features, replacing the words 'Hotel du lac' (which we have noticed has also been typed in occasionally as 'hotel su lac') with the words 'Hôtel du Lac':
|
![]() |
The ttrack macro is useful as a way of taking you to the right page after a search. |
![]() |
Each search field is limited 130 characters, so the total string has a length of only 260 characters. Beyond this amount you could make a simple script to select/cut/paste to your requirements. See 3B2 Scripting |
Document created on 08-Feb-2003 (revision 1)