|  | ## Replace

#### Synopsis

This operator replaces parts of the values of nominal attributes.

#### Description

This operator replaces parts of the string values of all nominal attributes it is applied on. The attribute filter type gives the possibility to restrict them. For each value of each attribute it is checked if the regular expression of replace what matches the string. Each matching part of the string will be replaced by the value of the replace_what parameter. The replacement might be empty and can contain capturing groups. Please keep in mind that although regular expressions are much more powerful than simple strings, you might simply enter characters to search for.

#### Examples

The attribute contains the values "color red", "color green" and "color blue".

- replacing "color" by "" yields: " red", " green", " blue"
- replacing "color" by "colour" yields: "colour red", "colour green", "colour blue"
- replacing "color\s" by "" yields: "red", "green", "blue"
- replacing "\s+" by "_" yields: "color_red", "color_green", "color_blue"
- replacing "color\s(.*)" by "$1" yields: "red", "green", "blue"
- replacing ".*\s(.*)" by "$1" yields: "red", "green", "blue"

</p>

#### Input

- example set input: expects: ExampleSetMetaData: #examples: = 0; #attributes: 0

#### Output

- example set output:
- original:

#### Parameters

- attribute filter type: The condition specifies which attributes are selected or affected by this operator.
- attribute: The attribute which should be chosen.
- attributes: The attribute which should be chosen.
- regular expression: A regular expression for the names of the attributes which should be kept.
- use except expression: If enabled, an exception to the specified regular expression might be specified. Attributes of matching this will be filtered out, although matching the first expression.
- except regular expression: A regular expression for the names of the attributes which should be filtered out although matching the above regular expression.
- value type: The value type of the attributes.
- use value type exception: If enabled, an exception to the specified value type might be specified. Attributes of this type will be filtered out, although matching the first specified type.
- except value type: Except this value type.
- block type: The block type of the attributes.
- use block type exception: If enabled, an exception to the specified block type might be specified.
- except block type: Except this block type.
- numeric condition: Parameter string for the condition, e.g. '>= 5'
- invert selection: Indicates if only attributes should be accepted which would normally filtered.
- include special attributes: Indicate if this operator should also be applied on the special attributes. Otherwise they are always kept.
- replace what: A regular expression specifying what should be replaced.
- replace by: The replacement for the region matched by the regular expression. Possibly including capturing groups.

#### ExampleProcess