日期:2014-05-19  浏览次数:20701 次

取字符串中的数字
C#如何利用正则表达式取出字符串中的数字
例如:string   str= "AAA123BB ";
现在要取出123

------解决方案--------------------
try

string str = "AAA123BB ";
string result = string.Empty;
Match m = Regex.Match(str, @ "\d+ ");
if (m.Success)
{
result = m.Value;
}