using System;
using System.Text.RegularExpressions;
namespace P10_10
{
    class Program
    {
       static void Main(string[] args)
        {
            // һʽСλʵ
            Regex rx = new Regex(@"^-?\d+(\.\d{1,2})?$");
            // һЩַ
            string[] tests = { "-42.1", "19.99", "0.001", "100 USD" };
            //testsеÿһַǷʽҪ
            foreach (string test in tests)
            {
                if (rx.IsMatch(test))
                {
                    Console.WriteLine("{0} ʽҪ", test);
                }
                else
                {
                    Console.WriteLine("{0} ʽҪ", test);
                }
            }
            Console.ReadLine();
        }
    }
}
