Hey,
Okay, this is a very quick example this morning, and I am only just starting to wake up so likely to be things wrong with it, but have a look, and let me know what you think.
By the way, TextFile1, is just a text file that I copied the example input that you gave above into.
It is doing what I expect it to at least, i.e. displays the texture information.Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim inputFile As String = System.IO.File.ReadAllText("TextFile1.txt") Dim m As System.Text.RegularExpressions.Match Dim myRegex As New System.Text.RegularExpressions.Regex("\( \d{3,4} -\d{3,4} \d{3,4} \) \( \d{3,4} -\d{3,4} \d{3,4} \) \( \d{3,4} -\d{3,4} \d{3,4} \) (?<1>\w*/\w* )", System.Text.RegularExpressions.RegexOptions.IgnoreCase Or System.Text.RegularExpressions.RegexOptions.Compiled) m = myRegex.Match(inputFile) While m.Success MessageBox.Show("Found match " & m.Groups(1).Value & " at " & m.Groups(1).Index.ToString()) m = m.NextMatch() End While End Sub
It is quite a crude regex, and could easily be refined, but hopefully it will get you on your way.
Gary





Reply With Quote