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.

The 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.

The important properties are described below:

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

REST API

The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.

You can use cURL command-line tool to access Aspose.Words web services easily. The following example shows how to make calls to Cloud API with cURL.

Cloud SDK Family

Using an SDK is the best way to speed up the development. An SDK takes care of low-level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Words Cloud SDKs.

The following code examples demonstrate how to make calls to Aspose.Words web services using various SDKs: