'regex pattern for validating
Dim pattern As String = "^(http|https):/{2}[a-zA-Z./&\d_-]+"
'create a new RegEx object
Dim reg As New Regex(pattern, RegexOptions.IgnoreCase Or RegexOptions.ExplicitCapture)
If reg.IsMatch(txtURL.Text) = False Then
MsgBox("invalid url!")
Else
MsgBox("valid url!")
End If