Regex readability improvements
This commit is contained in:
parent
87d5031e92
commit
bfff79c929
1 changed files with 10 additions and 10 deletions
|
@ -17,25 +17,25 @@ RE_HEADER = re.compile(r'''
|
||||||
[ ] (?P<numlev>[0-9\ ]{4})
|
[ ] (?P<numlev>[0-9\ ]{4})
|
||||||
[ ] (?P<p_src>.{8})
|
[ ] (?P<p_src>.{8})
|
||||||
[ ] (?P<np_src>.{8})
|
[ ] (?P<np_src>.{8})
|
||||||
[ ] (?P<lat>[0-9 ]{7})
|
[ ] (?P<lat>[0-9\- ]{7})
|
||||||
[ ] (?P<lon>[0-9 ]{8})
|
[ ] (?P<lon>[0-9\- ]{8})
|
||||||
$
|
$
|
||||||
''', re.X)
|
''', re.X)
|
||||||
|
|
||||||
RE_SAMPLE = re.compile(r'''
|
RE_SAMPLE = re.compile(r'''
|
||||||
^ (?P<lvltyp1>\d)
|
^ (?P<lvltyp1>\d)
|
||||||
(?P<lvltyp2>\d)
|
(?P<lvltyp2>\d)
|
||||||
[ ] (?P<etime>[0-9 \-]{5})
|
[ ] (?P<etime>[0-9\- ]{5})
|
||||||
(?P<press>[0-9 \-]{7})
|
(?P<press>[0-9\- ]{7})
|
||||||
(?P<pflag>[AB ])
|
(?P<pflag>[AB ])
|
||||||
(?P<gph>[0-9 \-]{5})
|
(?P<gph>[0-9\- ]{5})
|
||||||
(?P<zflag>[AB ])
|
(?P<zflag>[AB ])
|
||||||
(?P<temp>[0-9 \-]{5})
|
(?P<temp>[0-9\- ]{5})
|
||||||
(?P<tflag>[AB ])
|
(?P<tflag>[AB ])
|
||||||
(?P<rh>[0-9 \-]{5})
|
(?P<rh>[0-9\- ]{5})
|
||||||
[ ] (?P<dpdp>[0-9 \-]{5})
|
[ ] (?P<dpdp>[0-9\- ]{5})
|
||||||
[ ] (?P<wdir>[0-9 \-]{5})
|
[ ] (?P<wdir>[0-9\- ]{5})
|
||||||
[ ] (?P<wspd>[0-9 \-]{5})
|
[ ] (?P<wspd>[0-9\- ]{5})
|
||||||
''', re.X)
|
''', re.X)
|
||||||
|
|
||||||
def etime_to_seconds(etime: str) -> int:
|
def etime_to_seconds(etime: str) -> int:
|
||||||
|
|
Loading…
Add table
Reference in a new issue