-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add builtin regex function #120
Conversation
actually just realized this might not handle error situations very well, will add some more tests later |
Great work! |
Will do, probs won't have time tonight but maybe tomorrow |
@kaikalii changed the cache to use a thread local and also added some recovery code (invalid pattern, 0 matches) so it should be more stable now. |
looks like build is failing for using an unstable feature, will look into implementing around it tomorrow |
That's slightly annoying, the feature it's erroring for because it's unstable has been all but approved: rust-lang/rust#92122 Not sure if there's a way to disable this error as it's not really important based on that rust Lang pr E: can just add the feature flag to the crate flag, will do it tomorrow |
Why not just use |
@kaikalii changed with_borrow_mut to with followed by a borrow_mut |
Context
This adds the Rust Regex package as a dependency and adds a simple
regex
function (without a glyph alias) which executes a pattern and returns a list of boxed strings representing each of the matching groups.I also added a hashmap cache to the Uiua environment, which we use as a pattern cache.
Let me know if you'd like any changes.