:doc:`WAF <../../waf>` / Client / update_regex_pattern_set

************************
update_regex_pattern_set
************************



.. py:method:: WAF.Client.update_regex_pattern_set(**kwargs)

  

  .. note::

    

    This is **AWS WAF Classic** documentation. For more information, see `AWS WAF Classic <https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html>`__ in the developer guide.

     

    **For the latest version of AWS WAF**, use the AWS WAFV2 API and see the `AWS WAF Developer Guide <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html>`__. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

    

   

  Inserts or deletes ``RegexPatternString`` objects in a  RegexPatternSet. For each ``RegexPatternString`` object, you specify the following values:

   

  
  * Whether to insert or delete the ``RegexPatternString``.
   
  * The regular expression pattern that you want to insert or delete. For more information, see  RegexPatternSet.
  

   

  For example, you can create a ``RegexPatternString`` such as ``B[a@]dB[o0]t``. AWS WAF will match this ``RegexPatternString`` to:

   

  
  * BadBot
   
  * BadB0t
   
  * B@dBot
   
  * B@dB0t
  

   

  To create and configure a ``RegexPatternSet``, perform the following steps:

   

   
  * Create a ``RegexPatternSet.`` For more information, see  CreateRegexPatternSet.
   
  * Use  GetChangeToken to get the change token that you provide in the ``ChangeToken`` parameter of an ``UpdateRegexPatternSet`` request.
   
  * Submit an ``UpdateRegexPatternSet`` request to specify the regular expression pattern that you want AWS WAF to watch for.
   

   

  For more information about how to use the AWS WAF API to allow or block HTTP requests, see the `AWS WAF Developer Guide <https://docs.aws.amazon.com/waf/latest/developerguide/>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRegexPatternSet>`_  


  **Request Syntax**
  ::

    response = client.update_regex_pattern_set(
        RegexPatternSetId='string',
        Updates=[
            {
                'Action': 'INSERT'|'DELETE',
                'RegexPatternString': 'string'
            },
        ],
        ChangeToken='string'
    )
    
  :type RegexPatternSetId: string
  :param RegexPatternSetId: **[REQUIRED]** 

    The ``RegexPatternSetId`` of the  RegexPatternSet that you want to update. ``RegexPatternSetId`` is returned by  CreateRegexPatternSet and by  ListRegexPatternSets.

    

  
  :type Updates: list
  :param Updates: **[REQUIRED]** 

    An array of ``RegexPatternSetUpdate`` objects that you want to insert into or delete from a  RegexPatternSet.

    

  
    - *(dict) --* 

      .. note::

        

        This is **AWS WAF Classic** documentation. For more information, see `AWS WAF Classic <https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html>`__ in the developer guide.

         

        **For the latest version of AWS WAF**, use the AWS WAFV2 API and see the `AWS WAF Developer Guide <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html>`__. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

        

       

      In an  UpdateRegexPatternSet request, ``RegexPatternSetUpdate`` specifies whether to insert or delete a ``RegexPatternString`` and includes the settings for the ``RegexPatternString``.

      

    
      - **Action** *(string) --* **[REQUIRED]** 

        Specifies whether to insert or delete a ``RegexPatternString``.

        

      
      - **RegexPatternString** *(string) --* **[REQUIRED]** 

        Specifies the regular expression (regex) pattern that you want AWS WAF to search for, such as ``B[a@]dB[o0]t``.

        

      
    

  :type ChangeToken: string
  :param ChangeToken: **[REQUIRED]** 

    The value returned by the most recent call to  GetChangeToken.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ChangeToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ChangeToken** *(string) --* 

        The ``ChangeToken`` that you used to submit the ``UpdateRegexPatternSet`` request. You can also use this value to query the status of the request. For more information, see  GetChangeTokenStatus.

        
  
  **Exceptions**
  
  *   :py:class:`WAF.Client.exceptions.WAFStaleDataException`

  
  *   :py:class:`WAF.Client.exceptions.WAFInternalErrorException`

  
  *   :py:class:`WAF.Client.exceptions.WAFLimitsExceededException`

  
  *   :py:class:`WAF.Client.exceptions.WAFNonexistentItemException`

  
  *   :py:class:`WAF.Client.exceptions.WAFNonexistentContainerException`

  
  *   :py:class:`WAF.Client.exceptions.WAFInvalidOperationException`

  
  *   :py:class:`WAF.Client.exceptions.WAFInvalidAccountException`

  
  *   :py:class:`WAF.Client.exceptions.WAFInvalidRegexPatternException`

  