Imports System.Text.RegularExpressions
Module Example
Public Sub Main()
Dim inputs() As String = { "111", "13579753", "3557798", "335599901" }
Dim pattern As String = "^[0-9-[2468]]+$"
For Each input As String In inputs
Dim match As Match = Regex.Match(input, pattern)
If match.Success Then Console.WriteLine(match.Value)
Next
End Sub
End Module
|