Search/replace (W)

Modified on Mon, 5 Oct at 1:53 PM

With BaseExtensions, we are able to perform a search for specific words, letter or characters to replace them with another specified word, letter or character. This feature is compatible in both Word and PowerPoint. Read about PowerPoint solution here.

Module is located here:

Code
...\ModuleLibrary\BaseExtensions\03_nocontext_Productivity Tools\45_WP_searchReplace.xml

CMD

<Cmd case="BaseExtensions:search-replace" to-search="x" to-replace="y"/>

Parameters

to-search

Define what the command should search for, e.g. "hi".

to-replace

Define what the to-search parameter should be replaced with, e.g. "hello".

This will search a document for "hi" and replace it everywhere with "hello".

selection-only

Define as either true or false to define whether or not the functionality should apply only to the users selection.

match-wildcards

This parameter is optional. Define as either true or false to determine whether or not the search should match on wildcards. If the parameter is omitted it will use the old functionality. This parameter is relevant if the to-search parameter contains characters that can be considered wildcards. If the to-search parameter text uses the character as a wildcard then it should be set to true. If the characters in the to-search text should be replaced (considered as normal text) this parameter should be set to true. If no suchcharacter is present in the to-search text this parameter should be omitted.

Following table shows a few common wildcards. For more information and more wildcards read more here.

Wildcard Purpose Example
? Any single character h?t will find hat, hot, and h t
* Any number of characters a*d will find ad, ahead, and as compared
[ ] One of these characters t[ai]n will find tan and tin, but not ton
@ One or more instances of a character cor@al will find coral and corral

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article