C# 正则表达式从字符串c获取名称#

C# 正则表达式从字符串c获取名称#,c#,regex,string,C#,Regex,String,大家好,我怎样才能得到NGG-Acid 从这个字符串 "????log L 06/11/2012 - 06:45:28: \"NGG - Acid<5><STEAM_ID_PENDING><>\" connected, address \"46.49.70.30:27005\"\n\0" 你的比赛将在第1组 \\"(.*?)< \\”(.*< 如果我们假设您想要的匹配在\“和之间,如果您想要使用正则表达式: Match match = Regex.

大家好,我怎样才能得到
NGG-Acid

从这个字符串

"????log L 06/11/2012 - 06:45:28: \"NGG - Acid<5><STEAM_ID_PENDING><>\" connected, address \"46.49.70.30:27005\"\n\0"

你的比赛将在第1组

\\"(.*?)<
\\”(.*<

如果我们假设您想要的匹配在\“和之间,如果您想要使用正则表达式:

Match match = Regex.Match(Data, @"\\""(.+?)<\d+?><ST");

if (match.Success) {
    Console.WriteLine(match.Groups[1].Value);
}

Match Match=Regex.Match(数据,@“\\”(.+?)字符串中的哪一部分是用户名?谢谢,但是如果用户名是Acid<它只给出Acid,或者如果名称是经过编辑的,我的Regex…但是像这样解析日志总是很困难的,因为总是有一些情况下它不能正常工作。请查看我对Khôi评论的评论
\\"(.*?)<
var c = Regex.Match(@"""????log L 06/11/2012 - 06:45:28: \""NGG - Acid<5><STEAM_ID_PENDING><>\"" connected, address \""46.49.70.30:27005\\""\n\0"""
, @"\\""(.*?)<").Groups[1].Value;
Match match = Regex.Match(Data, @"\\""(.+?)<\d+?><ST");

if (match.Success) {
    Console.WriteLine(match.Groups[1].Value);
}