-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex in CMIP6_CV.json to test *_index
attributes
#281
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
CMIP6_CV.json
contains regular expressions to test the global attributesphysics_index
,initialization_index
,forcing_index
andrealization_index
for correctness. These global attributes should be integers (CMIP6 Global Attributes, DRS, Filenames, Directory Structure, and CV’s). Therefore, the CMOR PrePARE.py script) just checks the type of these attributes and does not use the regex ofCMIP6_CV.json
.However, the regular expression provided in
CMIP6_CV.json
seems to check for an arbitrary number of[
in front and]
behind the integer. I don't understand, why this is done. This seems to contradict CMIP6 Global Attributes, DRS, Filenames, Directory Structure, and CV’s.evaluation of the regular expression
In the
CMIP6_CV.json
the regex for testing the*_index
attributes is written as:The first
\
of each\\
escapes the second\
. That's clear. Without escapes we haveI assume that we have a POSIX Basic Regular Expression. That means that
\[
and\]
are taken literally.\{n,\}
are intepreted as: "the sign/character/number left of this expression may appearn
to infinite times". The^
and$
are the beginning and end of a line, respectively. Thus, we haveThese values would be captured by the regular expression:
But also these values would be captured by the regular expression:
I would have expected this regular expression
or
The text was updated successfully, but these errors were encountered: