json - What is the Regex for this case -


i want "superhouse" value "house" expression json return. tried "house":"(.+?)" didnt work.

    {     type: "benefits"     members: [1]     0:  {     type: "benefits2"     house: {     color: "red"     name: "superhouse"     category: "big hoses"            }         }    } 

what regex?

"house":"(.+?)" doesn't work because value of house property not surrounded quotes , there space between value , :. these things have consider when constructing regex values out of json properties.

if json looks , need specific value 1 time, can use "house": (.*).

you should using json parser whatever platform working with. many languages/platforms have built-in json parsers including javascript , php. others java have popular libraries gson , jackson

if need in bash/command line, recommend jsawk


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -