Searching for Text in Existing Strings

If you use strings for error messages or form labels in an application, your schema may contain a number of strings.

The String Browser enables you to search for specified text within strings in the same schema so that you do not have to define a new string when there may be an existing or similar string in the schema that you can use.

To search for text in a string

  1. Select the Find Text command from the Search menu.

    The Search Translatable Strings dialog, shown in the following image, is then displayed.

  2. In the Search Text combo box, specify the text that you want to locate in another string in the current schema.

  3. If you want the exact match by case (where uppercase or lowercase is significant), check the Case Sensitive check box. A search is then performed in all strings in the current schema for text with the same capitalization as the text in the Search Text combo box. By default, searching is case‑insensitive; that is, this check box is unchecked.

  4. If you want to locate only a complete word, check the Full Word Only check box. A search is then performed only for full words in strings that match your specified text. By default, any text that matches the specified text is located; that is, this check box is unchecked.

  5. If you want the search text to be interpreted as a regular expression pattern, check the Regex check box; for example, enter [A-Za-z]+\d{4} to search for a word followed by a four‑digit number. By default, the Regex check box is unchecked. If you check the Regex check box, the Separate Lines check box is enabled.

    The following list shows examples of regular expressions that you can use in a Regex search. To search for:

    • At least a 4‑ or 5‑digit number assignment ignoring whitespace; for example, an error code

      \s*:=\s*\d{4,5}
    • Transaction methods

      (abortTransaction|beginTransaction|commitTransaction)
    • unloadForm in an epilog

      epilog[\s\S]*unloadForm
    • A variable declaration named userName

      vars[\s\S]*\buserName\b[\s\S]*begin
  6. If you want to treat the search text as if it is broken up into separate lines, check the Separate Lines check box; for example, if you want to search for a specified string at the start or end of a line, check this check box. When this check box is checked, the search breaks the text into individual lines at each CrLf end‑of‑line sequence. By default, the Separate Lines check box is unchecked.

  7. Click the Find button to initiate the search for the specified string in all strings in the current schema. Alternatively, click the Cancel button to abandon your search criteria.

If no occurrences of your specified text are located in any string in the schema, a message dialog is displayed, advising you that the search text was not found.

If occurrences of your specified text are located, the Find Text dialog, like that shown in the following example, is then displayed.

The Find Text dialog allows you only to view located strings that match your search criteria. Modify an existing string by making the changes that you require in the editor pane of the String Browser itself. (Alternatively, to delete an existing string, select the string in the list at the left of the String Browser and then click the Delete button.)

When you have viewed the located strings, click the Close button to exit from the Find Text dialog and return focus to the String Browser.

If no located strings meet your requirements but a similar one has been located, you can select that string or text within a located string and then copy it into the editor pane of the Add String dialog. (For details, see "Adding Strings", earlier in this chapter.)