Finding and replacing code strings in scripts
The Windows client script editor ( Edit Form/Global Script dialog box) provides tools to find and optionally replace strings in code.
To find and optionally replace a string in the code:
-
Click the
Find and Replace tab on the
far right side of the editor.
Note: You can also access this tab through the Edit menu, by means of the Find or Replace options.
We recommend that you pin the tab open.
- To perform a find-and-replace operation, click on the scroll bar to the right of the Quick Find subtab, and then click Quick Replace.
- In the Find what field, enter the string you want to search for.
- For a find-and-replace operation, in the Replace with field, enter the string to replace the original string with.
- In the Look in field, specify whether you want to search the entire Document or just the current code Selection (code selected by click-and-drag).
- Optionally, select one or more Find options.
-
Optionally, specify a
Search type:
- Normal: This option searches for the Find what text exactly as specified and replaces it with the exact text as entered into the Replace with field.
- Regular expression: This option uses regular
expressions to locate the search text, and uses regular expression replace
pattern syntax. This allows for replacements at different matched capture
points in the search pattern.
For more information, see Script regular expression searches.
- Wildcard: This option uses simple wildcard
search patterns to locate the text.
For more information, see Script search wildcards.
- Acronym: This option matches a character at
the start of a word, and then every capital letter or character following an
underscore.
For example, if you specify fr as the acronym pattern, the search would match the text findR in the word findReplace.
- Shorthand: This option is similar to the
Acronym option but
allows any non-whitespace character to be between the search pattern
characters. In this case, space characters have a special meaning, in that they
match to any whitespace character.
For example, if you specify fr as the shorthand pattern, the search would match the text for in the word therefore. If you were to specify f r as the shorthand pattern (with a space between the letters), the search would match the text "f this r" in the phrase If this runs.