You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the CMIP6_CV.json the regex for testing the *_index attributes is written as:
^\\[\\{0,\\}[[:digit:]]\\{1,\\}\\]\\{0,\\}$
The first \ of each \\ escapes the second \. That's clear. Without escapes we have
^\[\{0,\}[[:digit:]]\{1,\}\]\{0,\}$
I 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 appear n to infinite times". The ^ and $ are the beginning and end of a line, respectively. Thus, we have
^ : beginning of the line
\[\{0,\} : `[` appears zero to infinite times
[[:digit:]]\{1,\} : a digit between `0` and `9` appears one to infinite times
\]\{0,\} : `]` appears zero to infinite times
$ : end of the line
These values would be captured by the regular expression:
1
123
42
53253262
But also these values would be captured by the regular expression:
[1435]
[[123]]
[[123]
[123]]
[123]]]]]]]]]
I would have expected this regular expression
^[[:digit:]]\\{1,\\}$
or
^[[0-9]]\\{1,\\}$
^[[:digit:]]+$
^[[0-9]]+$
The text was updated successfully, but these errors were encountered:
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: