Regular Expressions 101

Community Patterns

Community Library Entry

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 - 9 years ago