SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [FormVerification](
	[VerificationID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NULL,
	[Rule] [varchar](500) NULL,
	[Remark] [nvarchar](50) NULL,
 CONSTRAINT [PK_FormVerification] PRIMARY KEY CLUSTERED 
(
	[VerificationID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET IDENTITY_INSERT [FormVerification] ON 

INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (1, N'数字验证', N'^\d+$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (2, N'字母验证', N'^[A-Za-z]+$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (3, N'格式不限', N'[\s|\S]?', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (4, N'邮箱验证', N'^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (5, N'URL地址', N'^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (6, N'身份证号码', N'\d{18}|\d{15}', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (7, N'国内座机', N'(\d{3}-|\d{4}-)?(\d{8}|\d{7})', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (8, N'字母数字及下划线', N'^\w+$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (9, N'数字和字母', N'^[A-Za-z0-9]+$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (10, N'中文字符', N'[\u4e00-\u9fa5]+', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (11, N'手机号码', N'^1{1}\d{10}$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (12, N'邮政编码', N'^[a-zA-Z0-9 ]{3,12}$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (13, N'日期格式', N'\d{4}\W\d{1,2}\W\d{1,2}', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (14, N'日期+时间', N'^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-9]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-)) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (15, N'IP地址', N'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', NULL)
INSERT [FormVerification] ([VerificationID], [Name], [Rule], [Remark]) VALUES (16, N'小数验证', N'^\d+([.\d]+)*$', N'包含小数点或整数')
SET IDENTITY_INSERT [FormVerification] OFF
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'验证表自增长编号,主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormVerification', @level2type=N'COLUMN',@level2name=N'VerificationID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'验证规则名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormVerification', @level2type=N'COLUMN',@level2name=N'Name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'验证规则(正则表达式)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormVerification', @level2type=N'COLUMN',@level2name=N'Rule'
GO
