-
Notifications
You must be signed in to change notification settings - Fork 114
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
Dynamic cap count #27
Comments
I had a friend of me code a solution for me. He is still a student and learning coding, but I thought it might be good practice for him. https://gist.github.com/IngwiePhoenix/1a060d80469390b2c142 likely not the most reliable solution, but definitively one that'll work :) |
I've coded up something like this in a fork https://github.com/sebgod/slre/commits/introduce-slre_compile-function not sure if that still merges. |
Would it be as simple as copying the value of variable "bi" (lines 282-284, where the sub-matches are captured) to global var and reference that? I did that for an add on for a scripting language and it seemed to work. In slre.h, I did: And in slre.c, after line 284, I added: ar_match_count is declared in another file. |
Well, I want to use SLRE in my project, which consists of just a tiny scripting language and tiny extensions. My goal is to use SLRE to introduce RegEx support to it. The problem is that, in the nature of a scripting language, the user might supply multiple capture groups.
That is why I want to ask: How can I best count the capture groups in the buffe,r and then perform matching? I could just go through the buffer and look for
(
s, but maybe there is an easier method?The text was updated successfully, but these errors were encountered: