---
title: "POST /#X-Amz-Target=AWSWAF_Regional_20161128.UpdateRegexPatternSet"
method: POST
path: "/#X-Amz-Target=AWSWAF_Regional_20161128.UpdateRegexPatternSet"
---

# POST /#X-Amz-Target=AWSWAF_Regional_20161128.UpdateRegexPatternSet

`POST /#X-Amz-Target=AWSWAF_Regional_20161128.UpdateRegexPatternSet`

<note> <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p> <p> <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use. </p> </note> <p>Inserts or deletes <code>RegexPatternString</code> objects in a <a>RegexPatternSet</a>. For each <code>RegexPatternString</code> object, you specify the following values: </p> <ul> <li> <p>Whether to insert or delete the <code>RegexPatternString</code>.</p> </li> <li> <p>The regular expression pattern that you want to insert or delete. For more information, see <a>RegexPatternSet</a>. </p> </li> </ul> <p> For example, you can create a <code>RegexPatternString</code> such as <code>B[a@]dB[o0]t</code>. AWS WAF will match this <code>RegexPatternString</code> to:</p> <ul> <li> <p>BadBot</p> </li> <li> <p>BadB0t</p> </li> <li> <p>B@dBot</p> </li> <li> <p>B@dB0t</p> </li> </ul> <p>To create and configure a <code>RegexPatternSet</code>, perform the following steps:</p> <ol> <li> <p>Create a <code>RegexPatternSet.</code> For more information, see <a>CreateRegexPatternSet</a>.</p> </li> <li> <p>Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code> parameter of an <code>UpdateRegexPatternSet</code> request.</p> </li> <li> <p>Submit an <code>UpdateRegexPatternSet</code> request to specify the regular expression pattern that you want AWS WAF to watch for.</p> </li> </ol> <p>For more information about how to use the AWS WAF API to allow or block HTTP requests, see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer Guide</a>.</p>

## Headers

- `X-Amz-Target` 'AWSWAF_Regional_20161128.UpdateRegexPatternSet', required

## Request body

- UpdateRegexPatternSetRequest
  - `RegexPatternSetId` string, required — The <code>RegexPatternSetId</code> of the <a>RegexPatternSet</a> that you want to update. <code>RegexPatternSetId</code> is returned by <a>CreateRegexPatternSet</a> and by <a>ListRegexPatternSets</a>.
  - `Updates` RegexPatternSetUpdate[], required — An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <a>RegexPatternSet</a>.
    - `Action` 'INSERT' | 'DELETE', required — Specifies whether to insert or delete a <code>RegexPatternString</code>.
    - `RegexPatternString` string, required — Specifies the regular expression (regex) pattern that you want AWS WAF to search for, such as <code>B[a@]dB[o0]t</code>.
  - `ChangeToken` string, required — The value returned by the most recent call to <a>GetChangeToken</a>.

## Response `200`

Success

- UpdateRegexPatternSetResponse
  - `ChangeToken` string — The <code>ChangeToken</code> that you used to submit the <code>UpdateRegexPatternSet</code> request. You can also use this value to query the status of the request. For more information, see <a>GetChangeTokenStatus</a>.

## Other responses

- `480` — WAFStaleDataException
- `481` — WAFInternalErrorException
- `482` — WAFLimitsExceededException
- `483` — WAFNonexistentItemException
- `484` — WAFNonexistentContainerException
- `485` — WAFInvalidOperationException
- `486` — WAFInvalidAccountException
- `487` — WAFInvalidRegexPatternException

---

[API](https://skmtc.net/aws/apis/waf-regional.md) · [All operations](https://skmtc.net/aws/apis/waf-regional/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/waf-regional/versions/12b830ff94fb/schema)
