嗨,大家好,我得到了与正则表达式的问题,希望有人能帮助我。
我有一个字符串列表,每个字符串包含17个英文字母的大写的字,我需要得到这个词从字符串。
事情是这样的:
string pattern = @"[A-Z0-9]{17}";
Regex regex = new Regex(pattern);
List<string> result = new List<string>();
foreach (string val in list)
{
Match match = regex.Match(pattern);
result.Add(match.Value);
}