I have this string
'bookmarkState={"params":{"date_from":"2014-07-31","date_to":"2014-10-01"}}'
I want to replace 2014-07-31 with 2014-01-01, i.e. the substring contained between '"date_from":"' and '","', using a regular expression in javascript. I have written this code but it doesn't work:
var qs = 'bookmarkState={"params":{"date_from":"2014-07-31","date_to":"2014-10-01"}};'
var regEx = /^(.*?date_from":")[^"]*(".*)$/;
qs = qs.replace(regEx, '2014-01-01');`