title: Extract bucket and resource name from S3 URL (regex question)
body: <p>I will be receiving input which will be ANY ONE of the following. I need to devise a regex which can handle any of these and extract the validS3bucketname and validS3resourcename.</p>
  
  <pre><code>http://s3.amazonaws.com/validS3bucketname/validS3resourcename
  https://s3.amazonaws.com/validS3bucketname/validS3resourcename
  http://validS3bucketname.s3.amazonaws.com/validS3resourcename
  https://validS3bucketname.s3.amazonaws.com/validS3resourcename
  </code></pre>
  
  <p>validS3bucketname and validS3resourcename are VALID S3 values, including spaces and whatever not - I have no idea what S3 allows as valid file names.</p>