mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-01-18 00:42:38 +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:
|
||||
match = re.match(r'''
|
||||
^ #start
|
||||
(MOVE|LINE|NODE) #command type
|
||||
(MOVE|LINE|NODE) #one of three command types
|
||||
\s+(-?[0-9.]+) #X-co-ord
|
||||
\s+(-?[0-9.]+) #Y-co-ord
|
||||
\s+(-?[0-9.]+) #altitude
|
||||
(?:\s+\[(\S*)\])* #node name inside []
|
||||
(?:\s+(.*))* #all optional flags
|
||||
$ #till the end of the line
|
||||
(?: #grouping without saving result - for station name
|
||||
\s+ #at least one space
|
||||
\[ #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)
|
||||
if not match:
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user