Dim objRegEx As System.Text.RegularExpressions.Regex
Dim objMatch As System.Text.RegularExpressions.Match
' Create regular expression
objRegEx = New System.Text.RegularExpressions.Regex( _
"(\d+\.?\d*|\.\d+)", _
System.Text.RegularExpressions.RegexOptions.Compiled)
' Match our text with the expression
objMatch = objRegEx.Match("John is 50. Acct #32315. Owes $34.21.")
' Loop through matches and display matching value in MessageBox
While objMatch.Success
Dim strMatch As String
strMatch = objMatch.Value
MessageBox.Show(strMatch)
objMatch = objMatch.NextMatch()
End While
Please SUBSCRIBE to get new articles directly into your Email inbox!
Dim objMatch As System.Text.RegularExpressions.Match
' Create regular expression
objRegEx = New System.Text.RegularExpressions.Regex( _
"(\d+\.?\d*|\.\d+)", _
System.Text.RegularExpressions.RegexOptions.Compiled)
' Match our text with the expression
objMatch = objRegEx.Match("John is 50. Acct #32315. Owes $34.21.")
' Loop through matches and display matching value in MessageBox
While objMatch.Success
Dim strMatch As String
strMatch = objMatch.Value
MessageBox.Show(strMatch)
objMatch = objMatch.NextMatch()
End While
Please SUBSCRIBE to get new articles directly into your Email inbox!
تعليقات
إرسال تعليق