Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(?!^xn--.*)(?!^.*(\.s3alias|--ol-s3)$)(?!^([0-9]+\.){3}[0-9]+$)(?!.*\.\.+)(^[a-z0-9][a-z0-9\-\.]{1,61}[a-z0-9]$)$
/
gm

Description

This matcher follows the rules given at https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html for legal s3 bucket names (the segment before the first slash if any)

Submitted by anonymous - a year ago (Last modified a year ago)