there is a string
"128728581": {"vehicleType": "vehicleType", "isAlive": true, "name": "name", "clanAbbrev": "", "team": 1, "events": {}, "isTeamKiller": false},
tried to do so
@"""\d+""[^}]+"
but the problem is that there is a closing bracket in the "events". as an option, did so
@"""\d+""[^}]+[^}]+events[^,]+[^}]+"
but just changing the string and the event will not work, how to do it right?
And one more question: you need to get from the same line a set of numbers at the beginning, did so
string[] arr = reg.Match(parse).ToString().Split('"'); reg = new Regex(@"\d+"); foreach (string val in arr) { if (reg.IsMatch(val)) { id = int.Parse(val); break; } }
but somehow not the best option (it seems to me).
The fact that this is JSON, I know that there are specials for parsing, but I need to pull out lines with the id I need from a large document, and then parse them.
P.s why the code tag does not work, I can not understand how to highlight the code?