This is a followup to an earlier question (Help Refining RegEx ("\b\d{6}([ ]{1,15})\d{7}\b")). The goal is to get the Lat/Lon from the file. This is denoted by an L or the pattern of 6d/7d. I incorrectly stated that there could not be an alpha between start of the Lat (305455) and the Lon (1025446). When I implemented the proposed Regex everything was great till I hit this file. Notice that ‘6770G37 contains an alpha and broke the pattern or that it had 6 digits and restarted the pattern. Not good enough with Reg Ex to figure it out. Here are three different patterns that I need to find. Thanks!
I FST E 030 66686500
L 305455 '6770G37 66686501
1025446 '6770G37 66686502
O ZCA/999 66686503
H 05 66686504
I ARA '* ACADIANA AIRPORT 29865996
L 300216 '2425 29865997
0915302 '2425 29865998
S MSY 29865999
I JENNA078033 ' ZFW L 322823 0923754 ' ZFW
(Transferred from deleted answer)
This is a followup to Gishu’s answer, but could not get the comments area to format well enough. The Regex he proposed L\s*(\d{6})\s*(?:'.*\n)?\s*(\d{7}) worked for several of the possibilities, but failed on this pattern using the .Net engine with multi-line option turned on.
The goal is to capture the Lat 322441 and the Lon 0994055.
Returned Match:
L 322441 '1325 66685780
Sample data…..
I ABI E 018 66685779
L 322441 '1325 66685780
0994055 '1325 66685781
O ZCF/999 66685782
H 05 66685783
Thanks again guys!
This is a followup to Gishu’s answer, but could not get the comments area to format well enough. The Regex he proposed L\s*(\d{6})\s*(?:'.*\n)?\s*(\d{7}) worked for several of the possibilities, but failed on this pattern using the .Net engine with multi-line option turned on.
The goal is to capture the Lat 322441 and the Lon 0994055.
Returned Match:
L 322441 '1325 66685780
Sample data…..
I ABI E 018 66685779
L 322441 '1325 66685780
0994055 '1325 66685781
O ZCF/999 66685782
H 05 66685783
Thanks again guys!
See if this one works..
L\s*(\d{6})\s*(?:'.*\n)?\s*(\d{7})Outputs: