^([0-9]|[0-9][0-9])$
string text = "123 plus 12 equal 135"; foreach (Match num in Regex.Matches(text, @"\d{1,3}")) { int result = Convert.ToInt32(num.Value); if (result <=100) Console.WriteLine(result); // output : 12 }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)