can any body help me? how can i use reguler expression in vb code?

i want a reguler expression program that maintain the ip address.

plz send me full code of ip addressing with reguler expression.

Here you have it. Insert the pattern of the IP Address you wanted to check
Function IsIPAddress(ByVal sMatchText As String) As Boolean
Diml sPattern As String
Dim oRegex As RegExp
Dim oRegexFnd As Object
On Error Resume Next
sPattern = "" ' Your IP Address PAttern
IsIPAddress = False
Set oRegex = New RegExp
oRegex.Global = True
oRegex.IgnoreCase = True
oRegex.Pattern = sPattern
Set oRegexFnd = oRegex.Execute(sMatchText)
If oRegexFnd.Count > 0 Then
IsIPAddress = True
Else
IsIPAddress = False
End If
'Destroy Objects
If Not oRegex Is Nothing Then Set oRegex = Nothing
If Not oRegexFnd Is Nothing Then Set oRegexFnd = Nothing
End Function
Note: You need to add reference to VB Script Regular Expressions

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.