Arbortext Command Language > Functions by Alphabetical Listing > replace
  
replace
 
replace(searchStr[, replaceStr[, flags[, element[, doc]]]])
This function searches for searchStr and replaces it with replaceStr. Returns 0 on failure. For success, if replace all is specified, then the number of replacements, else 1.
searchStr — The string to search for.
replaceStr — The string to replace searchStr.
flags — The bit mask for modifying the search.
0x0001 — backward search (-b)
0x0002 — case sensitive search (-c)
0x0004searchStr is regular expression (-e)
0x0008 — whole word only search
0x0010searchStr contains markup (-markup)
0x0020 — quiet search (-q) default is (-noq)
0x0040 — don't prompt for wrapping at end of instance (-wrapprompt)
0x0080 — wrap search (-wrapscan)
0x0100 — don't wrap search (-nowrapscan) default is -wrapscan preference
0x0200 — select searchStr when found (-select)
0x0400 — don't select searchStr when found (-noselect) default is -selectscan preference
0x0800 — search contents of entities (-entityscan)
0x1000 — don't search contents of entities (-noentityscan) default is -entityscan preference
0x2000 — replace all occurrences within instance
0x4000 — replace next occurrence of searchStr, then locate but don't replace the following occurrence (-find). Ignored if 0x2000 flag is set.
element — Search only the contents of elements with this name
doc — Current doc instance if not specified.