在具有 regex.h 的字符之间进行匹配

Match between characters with regex.h

我正在尝试匹配这样的字符串:"labels": [{"name": "labelname" 其中 labelname 可以包含任意数量的字母、数字或空格。我尝试了 "labels": \[\{"name": "(.*?)" ,它在 regex101.com 中有效,但我没有使用 posix regex.h 得到任何匹配项。如果我这样做 "labels": \[\{"name": " 它匹配字符串直到拳头 "

只做一个 class,select 除了结束字符之外的所有内容,就像那样:

"labels": \[\{"name": "([^"]*)"