Professional Documents
Culture Documents
This Is Java Experiment
This Is Java Experiment
RegularExpressions
Public Class Form2
Dim expMoileNo As New Regex("^(0|91)?[7-9][0-9]{9}$")
Dim expEmailId As New Regex("^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$")
Dim expDate As New Regex("(0[1-9]|[12][0-9]|3[01])[/](0[1-9]|1[012])[/]\d{4}")
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If (expMoileNo.IsMatch(TextBox1.Text.Trim())) Then
ErrorProvider1.SetError(TextBox1, "")
Else
ErrorProvider1.SetError(TextBox1, "Please enter valid mobile no")
End If
If (expEmailId.IsMatch(TextBox2.Text.Trim())) Then
ErrorProvider1.SetError(TextBox2, "")
Else
ErrorProvider1.SetError(TextBox2, "Please enter valid Email Id")
End If
If (expDate.IsMatch(TextBox3.Text.Trim())) Then
ErrorProvider1.SetError(TextBox3, "")
Else
ErrorProvider1.SetError(TextBox3, "Please enter valid Date")
End If
End Sub