How to handle "[key1:value1,key2:value2]"

I have got a input string like "[key1:value1,key2:value2]", how to get the value by key?

  Discussion posts and replies are publicly visible