Updated regex to format json valued elements