envoy
envoy copied to clipboard
regex: support partial matching in RE2
Signed-off-by: Xie Zhihao [email protected]
Commit Message: regex: support partial matching in RE2 Additional Description:
Earlier this year, a user asks to support partial match in RE2 in #19948. The user finds difficulty to migrate API gateway from Nginx to Envoy since they have many regex patterns in data processing, while the Nginx's regex engine (and most other proxies and WAFs using PCRE-like regex engine) matches any substring in the input against the regex pattern, which is the same behavior of partial matching in RE2.
Previously, we can modify the regex pattern /A/ to /.*A.*/ as a workaround, but since we have implemented regex engine interface, we can add an option to enable partial matching globally. It will be more friendly for our users.
Risk Level: Low Testing: Integration Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A
As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.
Please mark your PR as ready when you want it to be reviewed!
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
though at a high level I'm wondering if partial match regex should actually be a property of the higher layer matcher config as I'm guessing all engines would support this? This would be more user friendly if that's ultimately why we are doing this.
FWIW, I agree with this. I think this option would make a lot more sense as a field in the RegexMatcher proto.
FWIW, I agree with this. I think this option would make a lot more sense as a field in the RegexMatcher proto.
OK let's go with this. @zhxie can you rework this PR? Thank you.
/wait
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!
@zhxie Any change to merge this PR?