Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2020-06-16 21:59
Flavor·ECMAScript (JavaScript)

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

Description

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

Submitted by anonymous