Commit b9013088 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

use re.fullmatch

parent 39ccd07f
Pipeline #273 passed with stages
in 14 seconds
......@@ -43,6 +43,6 @@ Naming conventions
>>> r"L(?P<level>[0-9]+)_"
>>> r"(?P<version>[A-Z0-9]+).fits"
>>> )
>>> mo = re.search(pattern, r"CSST_MSC_MS_SCI_20270626203558_20270626203828_100000066_01_L0_1.fits")
>>> mo = re.fullmatch(pattern, r"CSST_MSC_MS_SCI_20270626203558_20270626203828_100000066_01_L0_1.fits")
>>> print(mo.groupdict())
{'facility': 'MSC', 'project': 'MS', 'data_type': 'SCI', 't_start': '20260612100759', 't_stop': '20260612101029', 'obs_id': '100000036', 'detector': '16', 'level': '0', 'version': '1'}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment