Crawler Regex Exclusion Examples - AWS S3 Buckets

The following are examples of crawler Regex exclusions:

Exclude all Folders Which Start With One or More Folder Names

Starting with bucket_name/folderName

Regex: bucket_name/folderName$

Starting with bucket_name/folderName or bucket_name/OtherFolderName

Regex: bucketName/(folderName|OtherFolderName)$

 

Include ONLY Folders Which Start With One or More Folder Names

Starting with bucket_name/shareName

Regex: ^(?!bucket_name/shareName($|/.*)).*

Starting with bucket_name/folderName or bucket_name/OtherFolderName

Regex: ^(?!bucket_name/(folderName|OtherFolderName)($|/.*)).*

Note: To write a backslash or a Dollar sign, add a backslash before it as an escape character.

Note: To add a condition in a single command, use a pipe character “|”