Skip to content

Conversation

@zpeschke
Copy link

Add std.regexMatch and std.regexSubst functions into the standard library.

I simply ported these functions from Grafana Tanka's jsonnet extensions.

Closes #409

@google-cla
Copy link

google-cla bot commented Jul 10, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ronniesena
Copy link

ronniesena commented Aug 4, 2025

Eagerly awaiting for this to be merged! :) @zpeschke

@juice928
Copy link

👋 Hi, I'm an automated AI code review bot. I ran some checks on this PR and found 1 point that might be worth attention (could be false positives, please use your judgment):

  1. The new regex builtins could benefit from regex compilation caching to improve efficiency.
    • Location: builtins.go:L1431-L1479
    • Impact: Repeatedly compiling the same pattern during loops or array operations may lead to high CPU overhead and slower performance.
    • Suggestion: Consider implementing a thread-safe cache (like an LRU cache or sync.Map) to store and reuse compiled regex objects.

If you find these suggestions disruptive, you can reply "stop" , and I'll automatically skip this repository in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regex support?

3 participants