Creating a regex pattern set
Follow the procedure in this section to create a new regex pattern set.
To create a regex pattern set
Sign in to the Amazon Web Services Management Console and open the Amazon WAF console at https://console.amazonaws.cn/wafv2/
. In the navigation pane, choose Regex pattern sets and then Create regex pattern set.
Enter a name and description for the regex pattern set. You'll use these to identify it when you want to use the set.
Note
You can't change the name after you create the regex pattern set.
For Region, choose Global (CloudFront) or choose the Region where you want to store the regex pattern set. You can use regional regex pattern sets only in web ACLs that protect regional resources. To use a regex pattern set in web ACLs that protect Amazon CloudFront distributions, you must use Global (CloudFront).
In the Regular expressions text box, enter one regex pattern per line.
For example, the regular expression
I[a@]mAB[a@]dRequest
matches the following strings:IamABadRequest
,IamAB@dRequest
,I@mABadRequest
, andI@mAB@dRequest
.Amazon WAF supports the pattern syntax used by the PCRE library
libpcre
with some exceptions. The library is documented at PCRE - Perl Compatible Regular Expressions. For information about Amazon WAF support, see Regular expression pattern matching in Amazon WAF. Review the settings for the regex pattern set, and choose Create regex pattern set.