JSONPath Expression Needed

Hello All,

Please I need a help to extract the power stat value from the JSON Expression below after i send a HTTP request so i get this message as result:

RESULT = {“POWER”:“ON”}
POWER1 = ON

The word "RESULT = " is the main problem so when I try to write POWER in JSONPath Expression to parse the power state value I got an error. I deleted the “RESULT =” and tried the JSONPath with an online extractor it works but am not able to get an HTTP reply without the “RESULT =”.

Thank you in advance.

Regards,

Hi,

as the result is not a valid JSON it would be hard to use JSONPath expression to parse it. However, it is easy to extract the information with a regular expression. The following one should do the job:

:"(\w+?)"

You can test and develop regular expressions on the site http://www.regexplanet.com/advanced/java/index.html

Kind regards,
Michal

Thank you very much Michal, Done !!