amazon web services - Regex on picking S3 bucket name from S3 URI -


i have been trying regex pattern obtain s3 bucket name s3 uri have no luck.

example: s3://example-bucket/file-name.filetype

closest this: \/\/([^\/].*[^\/])\/ i'm not sure how negate slash result

the part ([^/]+) looking sequence of of characters not slash. keeping close had write //([^/]+)/ same

//([^/]+) 

optional use lookbehind (?<=//) and/or lookahead (?=/)

(?<=//)([^/]+)(?=/) 

(depending on use cases couple of different lookahead expressions possible)

'lookaround' 'lookbehind' not supported in regexp dialects. e.g. not in javascript

debuggex demo


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -