> For the complete documentation index, see [llms.txt](https://docs.bountysecurity.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bountysecurity.ai/creating-profiles/match-and-replace.md).

# Match and replace

Transform request or payload text through the profile editor.

In an active profile, select the step and open **Original Request → Match and Replace**. These controls transform either the request or the payload.

1. Click **Add** to create a row.
2. Choose **Request** or **Payload** in **Item**.
3. Enter the text or pattern in **Match** and the replacement in **Replace**.
4. Choose **String** for a literal match or **Regex** for a regular expression in **Type**.
5. Review the rows and click **OK** to save the profile.

For example:

| Item    | Match                    | Replace               | Type   |
| ------- | ------------------------ | --------------------- | ------ |
| Request | `X-Environment: staging` | `X-Environment: test` | String |
| Payload | `BB_VALUE`               | `example`             | String |

Enter these values into the table cells. Pro generates the transformation objects in the saved profile. The exported field is named `Header`, but it is not a header-name/value dictionary.

Java and Server regex/replacement semantics are not identical for every expression or backreference. Validate the final bytes, especially after encoding and Content-Length changes.

The **scan launch dialog** also has request match/replace controls, which alter the selected input before scanning. Those settings and profile transformations are separate layers; avoid applying the same replacement twice.

To inject into a new header, use the **New HTTP Header Name** table described in [insertion points](/creating-profiles/insertion-points.md). That is a different operation from these transformations.

Server's exclusive `$BBOUNTY$` mode rejects profiles containing match/replace, including payload transformations, to preserve the selected mutation scope. Create a compatible variant in Pro rather than silently removing the selection.
