RegEx string after the specific word

Hi,

I have two examples of string:

  1. {“status”: “done”, “tenant”: “xyz”, “Comment”: w - 33 ww, “number”: “7233”}
  2. {“status”: “done”, “tenant”: “xyz”, “Comment”: “w - 33 ww”, “number”: “7233”}

What RegEx to use so that it always pulls out my value after the word “Comment”:
in this case it is: w - 33 ww.

it looks also as it is JSON Data, would the Comment value be surrounded by "

Regex:

(?<=Comment":).*?(?=\,)

@Paulina_x

These looks like jsons…you can download webapi package and then use deserializejson adna cess them easily and directly

Json(“Comment”) will give the value…json being in the output of desirialize json

If youstill want to do with regex…then

System.Text.RegularExpressions.Regex.Match(str,"(?<=Comment"":).*(?=\,)").Value.Replace("""","")

Cheers

For the JSON Data case:
grafik

  • output: myJObject

grafik

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.