使用此代码:
regex = new Regex(@"^(?:\S+\s){2}(\S+)");
match = regex.Match("one two three four five");
if (match.Success)
{
Console.WriteLine(match.Value);
}
我想检索该行的第三个单词 --> “three”。但相反,我得到了“一二三”。
编辑:我知道我可以用它来做,s.Split(' ')[2]但我想用正则表达式来做。
慕婉清6462132
摇曳的蔷薇
哈士奇WWW
随时随地看视频慕课网APP
相关分类