Replace

This REST API replaces text in a document.

If a captured or replacement string contains one or more special characters: paragraph break, cell break, section break, field start, field separator, field end, inline picture, drawing object, footnote, the API returns HTTP 400 error response.

Request parameters are the following:

Parameter Name Type Description
OldValue string Old text value (or regex pattern (see “IsOldValueRegex”)) to replace.
NewValue string New text value to replace by.
IsMatchCase bool Flag, true means the search is case-sensitive; false means the search is not case-sensitive. Not used if “IsOldValueRegex” is set.
IsMatchWholeWord bool The flag means that only whole word matched are replaced. Not used if “IsOldValueRegex” is set.
IsOldValueRegex bool The flag means that “OldValue” contains regex expression.

Important properties are the following:

Property Name Type Description
Matches integer Returns the number of matches.

Usage examples with cURL and Postman

You can carry out REST API interactions using cURL and Postman. Please read these instructions to receive a personal JWT_TOKEN for authorization.

Aspose.Words Cloud SDK Family

Using SDK is the best way to speed up the development. Please go to the GitHub repository to explore a wide family of our Cloud SDKs. These powerful libraries take care of all low-level programming details and let you focus on your primary tasks.

Usage examples in Python, Java, C#, etc.

The following code samples show how to interact with the REST API using almost any mainstream programming language.

You can find a lot of The following code samples show how to interact with the REST API using almost any mainstream programming language.

You can find a lot of other examples in Python, Java, C#, JavaScript, PHP, C++, Golang, Ruby, Swift, Dart on GitHub. All codes are thoroughly tested and ready for production use.