Reputation: 3025
Trying to parse this and return the following 3 items:
Using this regex expression below I get the matches, but drop the leading "-" at the front of each grouping. I get the "-" in the middle of the group though. Here is the expression I currently use.
Dim regex As New System.Text.RegularExpressions.Regex("\b\-{0,1}\d{1,2}\.{0,1}\d{0,2}\s{1}\-{0,1}\d{1,2}\.{0,1}\d{0,2}\s{1}\-{0,1}\d{1,2}\.{0,1}\d{0,2}\s{1}\-{0,1}\d{1,2}\.{0,1}\d{0,2}\b", RegexOptions.Singleline)
Thanks!
Here is the source text: [Airports]
[Airways]
-30.25 31.46 -27.46 31.74
-24.57 32.03 -16.86 32.88
-13.82 33.19 -9.69 33.62
[Arcs]
Upvotes: 0
Views: 85
Reputation: 57956
If I correctly understood your sample, try to use this: (-?\d+\.\d+ ?){4}
Upvotes: 0
Reputation: 38714
\b will not match at the beginning of your input if the first character is a dash (-)
Upvotes: 2