1 2 3 4 5 6 7 8 9
using System.Text.RegularExpressions; namespace Cmpp298.Assignment3.Domain { public class AmountEntrySpecification : ISpecification< string > { public bool IsSatisfiedBy( string input ) { return Regex.IsMatch( input, @"(^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)" ); } } }