RegEx Help

tbonejo

Member
Joined
Apr 22, 2005
Messages
9
Programming Experience
3-5
I have lines of text I am reading in and am trying to match the line with regex but I dont know if my pattern is correct.

The line looks like this, but multi cols, tab delimited.
0 38.159481
0.01 38.159481
0.02 38.312172
0.03 38.159481
0.04 38.159481
0.05 38.312172
0.06 38.312172
0.07 38.159481
0.08 38.464859
0.09 38.159481
0.1 38.159481

I just want the 0 and 0.1 and so forth on down.

This is my pattern Im using:
VB.NET:
Dim pattern As String = "^\d*(.[1-9])?|\.[1-9]\t.+"
 Dim myRegEx As New System.Text.RegularExpressions.Regex(pattern)
 Dim myInputString As String = mystreamreader.ReadLine
 
 
 If myRegEx.IsMatch(myInputString) Then
                myStreamWriter.WriteLine(myInputString)
             End If

I am reading the lines ok, but its not matching what I want.


Any clues?


Thanks.
 
Back
Top