namespace System.ComponentModel.DataAnnotations { using System; using System.ComponentModel.DataAnnotations.Resources; using System.Text.RegularExpressions; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] public sealed class PhoneAttribute : DataTypeAttribute { // see unit tests for examples private static Regex _regex = new Regex(@"^(\+\s?)?((? 0; } } }