-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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
timostamm
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request