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
It looks like the implementation of CEL matches, just calls Python re.search but Python re is not the same as RE2 as an example \z in RE2 should match the end of text, but \z in Python re is an invalid escape. The equivalent in Python re is \Z but that maps to an unsupported escape in RE2.
Example
echo '""' | python -m celpy 'string(this).matches("^\\z")'
# Should output true, but instead emits the error "re.error: bad escape \z at position 1"
echo '""' | python -m celpy 'string(this).matches("^\\Z")'
# Should be an error as \Z is not supported in RE2, but instead outputs true
Example of another CEL evaluator rejecting\Z but accepting \z
The text was updated successfully, but these errors were encountered:
It looks like the implementation of CEL
matches
, just calls Pythonre.search
but Pythonre
is not the same as RE2 as an example\z
in RE2 should match the end of text, but\z
in Pythonre
is an invalid escape. The equivalent in Pythonre
is\Z
but that maps to an unsupported escape in RE2.Example
Example of another CEL evaluator rejecting
\Z
but accepting\z
The text was updated successfully, but these errors were encountered: