Regular Expressions 101

S3 Bucket Info Extractor

Open Workspace
  • JavaScript
  • Match
0

Regular Expression

/
((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