mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-01-29 14:42:32 +00:00
further tidying and documenting of the main 3ddump file regexp
This commit is contained in:
parent
d6ee94bf79
commit
e7f536cfb7
@ -347,13 +347,21 @@ for fnm in ("../all.3d", "../alltracks.3d"):
|
|||||||
for l in file3d:
|
for l in file3d:
|
||||||
match = re.match(r'''
|
match = re.match(r'''
|
||||||
^ #start
|
^ #start
|
||||||
(MOVE|LINE|NODE) #command type
|
(MOVE|LINE|NODE) #one of three command types
|
||||||
\s+(-?[0-9.]+) #X-co-ord
|
\s+(-?[0-9.]+) #X-co-ord
|
||||||
\s+(-?[0-9.]+) #Y-co-ord
|
\s+(-?[0-9.]+) #Y-co-ord
|
||||||
\s+(-?[0-9.]+) #altitude
|
\s+(-?[0-9.]+) #altitude
|
||||||
(?:\s+\[(\S*)\])* #node name inside []
|
(?: #grouping without saving result - for station name
|
||||||
(?:\s+(.*))* #all optional flags
|
\s+ #at least one space
|
||||||
$ #till the end of the line
|
\[ #opening [
|
||||||
|
(\S*) #the station name we want to save
|
||||||
|
\] #closing ]
|
||||||
|
)? #end of optional station name group
|
||||||
|
(?: #grouping without saving result - for flags
|
||||||
|
\s+ #at least one space separating from [station]
|
||||||
|
(.*) #all the flags, including spaces
|
||||||
|
)? #end of optional flags group
|
||||||
|
$ #end of the line
|
||||||
''', l, re.VERBOSE)
|
''', l, re.VERBOSE)
|
||||||
if not match:
|
if not match:
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user