taskwarrior

RegEx to extract all matches from string using RegExp.exec

你离开我真会死。 提交于 2019-11-25 22:35:49
问题 I\'m trying to parse the following kind of string: [key:\"val\" key2:\"val2\"] where there are arbitrary key:\"val\" pairs inside. I want to grab the key name and the value. For those curious I\'m trying to parse the database format of task warrior. Here is my test string: [description:\"aoeu\" uuid:\"123sth\"] which is meant to highlight that anything can be in a key or value aside from space, no spaces around the colons, and values are always in double quotes. In node, this is my output: