Just a quick one, I'm probably just blind. I'm using regex to match bits of JSON data. I have this line:
String ErrorMessage = new Regex("\"message\":\"\\w+\"").Match(response).Value;
Which should hopefully match something like this:
"message":"This is a messsage"
But it isn't matching it at all, I know it's in there though.
Thanks in advance.
EDIT: While this might not be best practice, it's the first time that I've used both regex and JSON, and so didn't want to use any external APIs or libraries. I'll be sure to use something better in the future :)
This is not a duplicate, as I am not asking how to parse JSON, I'm simply asking why a regex doesn't match a pattern. Thanks.
Thanks for the answers!