易丰科技
标题:
c# regular express 找到文字中的数字
[打印本页]
作者:
Calvin
时间:
2011-10-6 16:05
标题:
c# regular express 找到文字中的数字
string reg = @"[+-]?((\d+(\.\d*)?)|\.\d+)([eE][+-]?[0-9]+)?";
string str = "dfgs4ae12r#@333";
System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(reg);
MatchCollection matches = regex.Matches(str);
复制代码
欢迎光临 易丰科技 (http://forum.yftek.com/)
Powered by Discuz! X3