# String Replace Filter

## Contents
Overview Configuration

## Overview
The String Replace filter enables you to replace all or part of the value of a specified message attribute. You can use this filter to replace any specified string or substring in a message attribute. For example, changing the `from` attribute in an email, or changing all or part of a URL.
## Configuration
To configure the String Replace filter, specify the following fields:
Name | Name of the filter to be displayed in a circuit. Defaults to String Replace. This field is required.
Message Attribute | Select the name of the message attribute to be replaced from the drop-down list. This field is required. If the value of this attribute is not specified, a `MissingPropertyException` is thrown, which results in a `CircuitAbortException`.
Specify Destination Attribute | By default, the value of the specified Message Attribute is both the source and destination, and is therefore overwritten. If you wish to specify a different destination attribute, select this checkbox to enable the Destination Attribute field, and select a value from the drop-down list.
Replacement String | The string used to replace the value of the specified source attribute. You can specify this as a property, which is expanded to the specified attribute value at runtime (for example, `${http.request.uri}`). This is a required field if you specify the Specify Destination Attribute.
Straight | A match string used to search the value of the specified source attribute. You can specify this as a property, which is expanded to the specified attribute value at runtime. If a straight (exact) match is found, it is replaced with the specified Replacement String.
Regexp | A match string, specified as a regular expression, used to search the value of the specified source attribute. You can specify this as a property, which is expanded to the specified attribute value at runtime. If a match is found, it is replaced with the specified Replacement String.
First Match | If a match is found, only replace the first occurrence.
All Matches | If a match is found, replace all occurrences.
Note: The possible paths available through this filter are `True` (even if no replacement takes place), and `CircuitAbort`. Under certain circumstances, if the Replacement String contains a message attribute property, a `MissingPropertyException` can occur, which results in a `CircuitAbortException`.