I have this JSON Response with a series of Error Codes like this
"TITLE": "Error: Customer Number Invalid",
"TITLE": "Error: Currency Invalid",
"TITLE": "Error: Payment is Unbalanced",
The number of error codes varies from every post request. I am trying to get the value under CODE. Is there a way to get it using regex? I tried using this
/(?<=")\d+(?=")/g But it only gets the numbers, the codes I get are mixed with characters.
Hope this expression helps you resolve this
Use Matches activity and mention this expression
This will get all the values of CODE of any type
Be it character or number
You can try with below Regex
mc = System.Text.RegularExpressions.Regex.Matches(yourString,"(?<=CODE\W+)\w+")
Note: mc is MatchCollection
Thank you very much! This worked for me.
This also worked, Thank you.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.