Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
((https|http):\/?\/?)?(?<bucket>[a-z\-]*)(\.s3\.)(?<server>[a-z\-\d]*)(\.amazonaws\.com\/)(?<key>[^?\s]*)(\?)?(?<extra>\??.*)
/
gi

Description

This one gets from a S3 Bucket URL the bucket name, the zone, and the key

Submitted by anonymous - 5 years ago