Find-Replace Text

Now reading version 17.1. For the latest, read: Find-Replace Text for version 22

    

   

Two variations of the Find-Replace Text dialog displaying both tabs

Summary

The Find-Replace Text dialog is used to quickly find and replace text in a text document. The Find Text dialog is used only to find text; the Replace Text dialog is used to find then replace text. This can save you from having to constantly scroll up or down to find text and is particularly useful when developing and debugging macro scripts.

Access

The dialog is accessed in the following ways:

  • The Find Text dialog is accessed by clicking Edit » Find within a text document.
  • The Replace Text dialog is accessed by clicking Edit » Replace within a text document.

Options/Controls

Find/Replace Text Tab

  • Text to find - enter the string of text to find in the document or use the drop down to select the string from previous searches.
  • Replace with - enter the string of text to replace the found text with or use the drop down to select the replacement string from previous replacement strings. This command is available only in the Replace Text dialog.
  • Options 
    • Case sensitive - check to perform the search paying attention the the case.
    • Whole words only - check to only find whole words.
    • Regular expressions - check to search using regular expressions.
      • ^ - only match when the string is at the start of a line.​
      • $ - only match when the string is at the end of a line.
      • . - indicates any single character (e.g., "te.t" matches "test", "text", and "tent", but not "tet").
      • - indicates any set of characters, including no characters (e.g., "te*" matches "text", "tent", and "te", but not "t").
      • + - indicates any set of characters, except no characters (e.g., "te+" matches "text", and "tent", but not "te").
      • [ ] - find any of the characters enclosed in the brackets.
      • [^] - a caret at the start of a string in brackets means NOT (e.g., "[^tes]" matches any characters except t, e, or s).
      • [-] - a hyphen within a string in brackets signifies a range of characters (e.g., "[l-o]" matches the characters l, m, n, and o).
      • { } - used to group characters or expressions. Groups can be nested with a maximum number of 10 groups in a single pattern.
      • - a backslash before a wildcard character tells the Text Editor to treat that character literally, not as a wildcard (e.g., "\^test" does not look for the string test at the start of a line; it looks for the string "^test").
  • Prompt on replace - check to be prompted before replacement occurs. This command is available only in the Replace Text dialog.
  • Search hidden text - check to include hidden text in the search.
  • Wrap search - check to wrap the search string. This command is available only in the Find Text dialog.
  • Scope
    • Global - select to search the entire document.
    • Selected text - select to only search currently selected text.
  • Direction - use these selections in conjunction with the Origin options to determine from where and how the text is searched:
    • Forward - select to perform the search forward from the cursor.
    • Backward -select to perform the search backward from the cursor.
  • Origin - use these selections in conjunction with the Direction options to determine from where and how the text is searched:
    • From cursor - select to begin the search from the cursor location.
    • Entire scope - select to perform the search of the entire document.

Find in Files/Replace in Files Tab

  • Text to find - enter the string of text to find in the document or use the drop down to select the string from previous searches.
  • Replace with - enter the string of text to replace the found text with or use the drop down to select the replacement string from previous replacement strings.
The Replace with command is available only in the Replace Text dialog.
  • Options 
    • Case sensitive - check to perform the search paying attention the the case.
    • Whole words only - check to find only whole words.
    • Regular expressions - check to search using regular expressions. Valid regular expressions include the following:
      • ^ - only match when the string is at the start of a line.​
      • $ - only match when the string is at the end of a line.
      • . - indicates any single character (e.g., "te.t" matches "test", "text", and "tent", but not "tet").
      • - indicates any set of characters, including no characters (e.g., "te*" matches "text", "tent", and "te", but not "t").
      • + - indicates any set of characters, except no characters (e.g., "te+" matches "text" and "tent", but not "te").
      • [ ] - find any of the characters enclosed in the brackets.
      • [^] - a caret at the start of a string in brackets means NOT (e.g., "[^tes]" matches any characters except t, e, or s).
      • [-] - a hyphen within a string in brackets signifies a range of characters (e.g., "[l-o]" matches the characters l, m, n, and o).
      • { } - used to group characters or expressions. Groups can be nested with a maximum number of 10 groups in a single pattern.
      • - a backslash before a wildcard character tells the Text Editor to treat that character literally, not as a wildcard (e.g., "\^test" does not look for the string "test" at the start of a line; it looks for the string "^test").
  • Prompt on replace - check to be prompted before replacement occurs. This command is available only in the Replace Text dialog.
  • Search hidden text - check to include hidden text in the search.
  • Where
    • Search all files in project - select to search within all files in the current project.
    • Search all open files - select to search within all open files.
    • Search in directories - select to search within directories.
    • Open changed files in editor - select to open changed files.
  • Search Directory Options 
    • File Mask -​ use the Browse button to open the Browse For Folder dialog and select the desired folder to search.
      • Include subdirectories - check to include subdirectories in the search.

Additional Controls

  • Replace All - click to replace all found strings with the text entered in Replace with textbox. This command is available only in the Replace Text dialog.
If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.
Note

The features available depend on your Altium product access level. Compare features included in the various levels of Altium Designer Software Subscription and functionality delivered through applications provided by the Altium 365 platform.

If you don’t see a discussed feature in your software, contact Altium Sales to find out more.