GS Example: Replace Curly Quotes with Straight Quotes

This example shows how to use the Global Substitution tool to find and replace curly double quotation marks with straight double quotation marks in structured documents.

Suppose your repository content includes structured documents with text that contains both curly quotes and straight quotes. Your organization's standard is to use only straight quotes. The Astoria search tool does not support searching for punctuation marks. The Global Substitution tool supports the use of regular expressions in rules to accomplish this goal.
  1. Select a cabinet or folder in the repository that contains the structured documents you want to change.
  2. Right-click the cabinet or folder and select Search > Global Stubstitution.
    The Global Substitution dialog appears.
  3. Click New three times to add rows to the table.
    The table now contains four rows.
  4. In the first row of the Substitute Parameters table, create a rule to include all XML documents in the cabinet, folder, and subfolders:
    1. In the Type field, select Preprocess.
    2. In the Find field, select getFolderItems.
    3. In the Find field, change the text inside the parentheses to (1, 0, 1)
  5. In the second row of the Substitute Parameters table, create a rule to process all elements:
    1. In the Type field, select Preprocess from the drop-down list.
    2. In the Find field, type getElements.
    3. In the Find field, change the text inside the parentheses to ("//*").
  6. In the third row of the Substitute Parameters table, create a rule using a regular expression to find open curly quotes and replace them with open straight quotes.
    1. In the Type field, select Change Text from the drop-down list.
    2. In the Find field, paste an open curly quotes character (“). (Alt 0147)
    3. In the Replace with field, type a straight quotes character.
    4. Select the RegEx check box.
  7. In the fourth row of the Substitute Parameters table, create a rule using a regular expression to find close curly quotes and replace them with close straight quotes.
    1. In the Type field, select Change Text from the drop-down list.
    2. In the Find field, paste a close curly quotes character (”). (Alt 0148)
    3. In the Replace with field, type a straight quotes character.
    4. Select the RegEx check box.
  8. Select the Check In check box.
  9. Type a Version Note.
    For example, GS: 3/22/16 Changed curly quotes to straight quotes.
  10. Review the dialog. It should look like this:


  11. Click OK.
A batch job is executed to perform the changes. When the job completes, you receive an email notification.

Structured documents that are changed during this job are updated and have the Version Note you entered.