Best Way To Find Pattern 6 digit space 7 digit ###### ####### with VB.NET

Parsing a text file in vb.net and need to locate the latitude and longitude in these two sections of text. The patter is 6 digits space 7 digits (364800 0953600). The samples are from two different map files and have slightly differing formats.

I 2H02 364800 0953600 '                 SEC72                           10496300-
I 2H05 360100 0953645 '                               ZFW J602 ZME 2A93 10496400-
I 2H06 361215 0952400 '                 SEC72                  ZME 2A75 10496500-
I 2H07 361715 0951145 '                 SEC27/72               ZME 2A78 10496600-
I 2H08 362025 0950100 '                 TUL                    ZME 2A69 10496700-
I 2H10 360800 0952915 '                                        ZME 2A85 10496800-
I 2H11 362500 0955015 '                 SEC62/72                        10496900-
I 2H14 364145 0954315 '                 TUL                             10497000-


I A85A                  'AL851                                50591 REF 33393944 
         391500 0831100 '                                     50591 REF 33393945 
I A85B                  'AL851                                50591 REF 33393946 
         374500 0825700 '                                     50591 REF 33393947 
I A87A                  'AL871                               111592 REF 33393948 
         402050 0814420 '                                    111592 REF 33393949 
I A87B                  'AL871                               111592 REF 33393950 
         400449 0814400 '                                    111592 REF 33393951 
I A87C                  'AL872                              '030394 GDK 33393952 
         392000 0810000 '                                   '030394 GDK 33393953

Thanks,

Dave

Answers


Dim matches As MatchCollection
Dim regex As New Regex("\d{6} \d{7}")
matches = regex.Matches(your_text_string)

A simple regex should do it:

[0-9]{6} [0-9]{7}

Need Your Help

iOS: Scrollview in storyboard won't scroll with embedded container views

ios storyboard interface-builder scrollview

I have a series of container views inside one scroll view. Currently, the view controller does not scroll vertically. Can a scroll view detect scroll touches through container view controllers?

QODBC wrong value for numeric

c++ sql-server database qt odbc

I try to select numeric(20,0) values from a Microsoft SQLServer database.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.