I have the following string, from which I want to extract the value of the key2
which is value2
[key1=value1,key2=value2,key3=value3]
I tried giving the following regex ,key2=(.*),\w+
but it is extracting ,key2=value2,key3
but I am want only the value value2
What regex can be used for this one?