10.1 Search And Replace

This section explains the search and replace functionality of the Librarian Interface.

Contents
Simple instructions
  Search and replace
Advanced instructions
  Match case
  Regular expressions
  Search space
Simple Instructions:

It becomes tedious to correct a spelling mistake in an metadata value one occurrence at time. Consequently the Librarian Interface includes a search and replace feature that allows text to be modified over the entire breadth of a collection. To search, click on the menu item [E]dit -> [S]earch, and to replace choose [E]dit- >Search and [R]eplace. Both prompts are essentially the same, but the former has the replace part disabled.

Type the term that you seek and press [F]ind to begin the search. The first matching text will be shown, in the appropriate view, using highlighting. Furthermore the [F]ind button is disabled and two new buttons become active. Find [N]ext carries on searching from the last match found, while re[S]tart causes the search position to be reset to the start so that pressing the re-enabled find button find the first match again.

If a replace prompt was chosen, you may type a text string to be substituted for any matches to the search term. When you enter a value in the 'Replace with' field, two new buttons become active. [R]eplace replaces the currently located text with the replacement text. If no text has yet been found, a find operation is run first. Replace [A]ll replaces all occurrences of the search term within the search space. Once you have performed a replace operation, the [U]ndo button becomes active. Clicking this will undo the most recent operation (or operations if you chose replace all). The Re[D]o button redoes something you've just undone. During any of these steps, Re[S]tart works exactly as described above (although the first match returned may not be the same if you have substituted it with replacement text).

At any time, in either prompt you may click the [C]lose button to hide the dialog prompt.

Advanced Instructions:

Below the text fields are several checkboxes that allow you to further customize the search. By default all searches are case insensitive, but you can change this by checking the match case box.

You can also use regular expressions within the search and replace text fields. Most standard regular expression functionality is supported, including capture groups. For instance you could choose to search for 'Re\(.*\)gees'. This will seek all the 'shortest' text fragments that match 're', followed by any number of characters, followed by 'gees' -- matching 'Refugees', for example. The 'any number of characters' is marked as a capture group (in this case capture group 1) by escaped parentheses. In the replace field you can type '\1\1', which if run would replace 'Refugees' with 'fufu'.

You can control just what gets searched by checking and unchecking the boxes called metadata elements, filenames and metadata values. Only those that are checked will be searched during a find operation.