Imports System
Imports System.Text.RegularExpressions
Public Module Module1
Sub WordsMathWith(ByVal str As String, ByVal expr As String)
Dim mc As MatchCollection = Regex.Matches(str, expr)
Dim word As Match
For Each word In mc
Console.WriteLine(word)
Next word
End Sub
Public Sub Main()
Dim str As String = "Marquee VB make net Make c programming m Mixable M Me"
WordsMathWith(str, "\bM\S*e\b")
End Sub
End Module
' run:
'
' Marquee
' Make
' Mixable
' Me
'