所有,我有以下字符串列表
List<string> list = new List<string>()
{
"Japanese (Japan) (ja-jp)",
"Scottish Gaelic (United Kingdom) (gd-gb)",
"German (Germany) (de-DE)",
"Amharic (Ethiopia) (am-et)"
};
我想从此列表中获取以下字符串:
ja-jp
gd-gb
de-DE
am-et
我目前正在使用组和Regex
Regex regex = new Regex(@"(.*)\s*(\(.*\))\s*(\(.*\))");
有人可以提供更好的Regex
吗?