I've got a string that looks like this:
1080p [2.1GB] 720p [1.3GB] 480p [500MB]
In Python, I want to replace all the [x]
with ,
. I've tried this code:
import re
s1 = '1080p [2.1GB] 720p [1.3GB] 480p [500MB]'
s2 = re.sub("[(.*?)]", ", ", s1)
However, I get as this output: 1080p [2, 1GB] 720p [1, 3GB] 480p [500MB]
.
Instead, I would like to obtain something like 1080p, 720p, 480p
.