Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 16150

regex to match comma separated aws regions in python

$
0
0

String has multiple data and need to find the match and get the value of comma separated aws regions

data = '''appname=ivrage=2yearsregion='us-east-1a,us-east-2a,us-east-1c''''

Would like to get the value for region in out put as 'us-east-1a,us-east-2a,us-east-1c'

tried using this regex but it works only for one value without comma

'(af|il|ap|ca|eu|me|sa|us|cn|us-gov|us-iso|us-isob)-(central|north|.       (north(?:east|west))|south|south(?:east|west)|east|west)-\d{1}'

Viewing all articles
Browse latest Browse all 16150

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>