How can I parse the string like
Text=”Andrey\’s Photos; Vacation”;Font=Arial;Size=12
to the javascript object object like:
var options = {
text: 'Andrey\'s Photos; Vacation',
font: 'Arial',
size: 12
}
My problem is that the value may contain ; and = characters, so I can not just use s.split(';'). But if there are such symbols in the values string, the value should be enclosed in single or double quotes. So the parsing of that string should be possible.
Assuming the answer is no:
EDIT: Edited to allow using either ‘ or ” as delimiter. However, you still can’t escape.
EDIT 2: Edited to use numeric type if applicable. Right now it just checks whether it can be coerced to a number, rather than trying to consider the quotes.