M
Michael R. Pierotti
Dim reg As New Regex("^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$")
Dim m As Match = reg.Match(txtIPAddress.Text)
If m.Success Then
'No need to do anything here
Else
MessageBox.Show("You need to enter a valid IP Address", "Error!",
MessageBoxButtons.OK, MessageBoxIcon.Hand)
txtIPAddress.Focus()
Return
End If
I need to match a IP addy on this and I would think this should match only a
x.x.x.x to xxx.xxx.xxx.xxx pattern yet it passes as a match when I input
192168121113
Any ideas what I am doing wrong here ?
Thanks,
Mike
Dim m As Match = reg.Match(txtIPAddress.Text)
If m.Success Then
'No need to do anything here
Else
MessageBox.Show("You need to enter a valid IP Address", "Error!",
MessageBoxButtons.OK, MessageBoxIcon.Hand)
txtIPAddress.Focus()
Return
End If
I need to match a IP addy on this and I would think this should match only a
x.x.x.x to xxx.xxx.xxx.xxx pattern yet it passes as a match when I input
192168121113
Any ideas what I am doing wrong here ?
Thanks,
Mike