Select Case e.DataCol.name
Case "身份证"
If System.Text.RegularExpressions.Regex.IsMatch(e.NewValue,"[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{4}")=False Then
MessageBox.show("身份证不正确")
e.Cancel=True
End If
Case "手机"
If System.Text.RegularExpressions.Regex.IsMatch(e.NewValue,"1\d{10}") =False Then
MessageBox.show("只能输入手机号码")
e.Cancel=True
End If
End Select