I have following text:
response={\n "status" : "ERROR",\n "message" : "<ERROR Mes$@ge can be anything>",\n "responseMessage" : "Response",\n "reason" : "REASON",\n }
I want to extract this part from the above text -
"message" : "<ERROR Mes$@ge can be anything>"
Please note - error message can have any chars including special chars.
I have written following regex -
\"message\" \: \".+\",\\n
However, it extracts till the last occurrence of ",\n
.
I think somehow I should count the occurrences of "
in the regex.
Need help with the Regex.