Imports System.Text.RegularExpressions
Module Module1
Sub Main
Dim txt As String ="42 43"
Dim re1 As String=".*?"
Dim re2 As String="(\s+)"
Dim re3 As String="(\d+)"
Dim r As Regex = new Regex(re1+re2+re3,RegexOptions.IgnoreCase Or RegexOptions.Singleline)
Dim m As Match = r.Match(txt)
If (m.Success) Then
Dim ws1=m.Groups(1)
Dim int1=m.Groups(2)
Console.WriteLine("("+ws1.ToString()+")"+"("+int1.ToString()+")"+"")
End If
Console.ReadLine()
End Sub
End Module
|