I have the string "{:name=>\"entry 1\", :description=>\"description 1\"}"
I'm using regex to get the values of name and description...
string = "{:name=>\"entry 1\", :description=>\"description 1\"}"
name = /\:name=>\"(.*?)\,/.match(string)
description = /\:description=>\"(.*?)\,/.match(string)
This however only returns name as #<MatchData ":name=>\"entry 1\"," 1:"entry 1\""> and description comes back as nil.
What I ideally want is for name to return "entry 1" and description come back as "description 1"
I'm not sure where I'm going wrong... any ideas?
eval(string).values #=> ["entry 1", "description 1"].