我有一个文本,其中包括:
"id": "100001470360923",
"name": "Đặng Minh Khiêm",
"first_name": "Đặng Minh",
"last_name": "Khiêm",
"link": "https://www.facebook.com/mrkhiem97",
"username": "mrkhiem97",
"birthday": "10/09/1992",
"location": {
"id": "108458769184495",
"name": "Ho Chi Minh City, Vietnam"
},
我正在尝试在 C# 中使用正则表达式来获取 2 个字符串:“id”:“100001470360923”“name”:“Đặng Minh Khiêm”
String patternID = "\"id\":\"\\d+\"";
String patternName = "\"name\":\"[\\w]+\"";
Match matchID = Regex.Match(data, patternID);
Match matchName = Regex.Match(data, patternName);
但它不适用于 patternName
我不知道如何使用模式。有人可以给我这个模式吗?