Regular Expressions 101

Community Patterns

Amazon S3 Scheme-Bucket-Key

1

Regular Expression
Python

r"
^(s3[na]?://)(.*:.*@)?([^/]*)/(.*)$
"

Description

Regex which finds and groups the Amazon S3 scheme (e.g. s3, s3n, s3a), bucket name, and key.

Submitted by Sterling Hoeree - 8 years ago