System.Text.RegularExpressions.Match ma = System.Text.RegularExpressions.Regex.Match(textBox1.Text,@"([0-9]*\.{0,1}[0-9]*)"); while (ma.Success) { string m = ma.ToString(); if(m!=string.Empty) MessageBox.Show(m); ma = ma.NextMatch(); }
Regex reg = new Regex(@"(?<=\w*(\w))\d*$"); Match m = reg.Match("NDDDJ我是有在井井有条123456789154856"); string num = m.Value; MessageBox.Show(num);
while (ma.Success)
{
string m = ma.ToString();
if(m!=string.Empty) MessageBox.Show(m);
ma = ma.NextMatch();
}
Match m = reg.Match("NDDDJ我是有在井井有条123456789154856");
string num = m.Value;
MessageBox.Show(num);