regular expression help needed

naitek

New member
Joined
Dec 16, 2004
Messages
1
Location
Nassau, Bahamas
Programming Experience
3-5
regular expression help all:


here is my function
VB.NET:
  Function openOrders(ByVal lbl As Control)
		'
		'
		Dim fptr As StreamReader = New StreamReader("order.dat")
		Dim line As String = fptr.ReadToEnd()
		' Dim r As Regex = New Regex("([s\d{1}]+[\d{1}]+ [\d{1}])")
		Dim r As Regex
		r = New Regex("^[s\d{1}]+[\d{1}]+ [\d{1}]")
		Dim result As String


		Dim mc1 As MatchCollection = r.Matches(line)

		Try
			For Each m As Match In mc1
				result &= m.Value
				If m.Value = "s1 6" Then
					Exit For
				End If

			Next

		Catch ex As Exception
			MsgBox(ex.Message)
		End Try
	End Function

why, when i run this i get gibbeish results?

The goal i have is to find certain text within the text file and if that text exists, do something like change a labels text with certain information.

It is for a college project.

any help would be awesome.

thanks again,

naitek
 
Back
Top