-
Notifications
You must be signed in to change notification settings - Fork 237
New pcre2_next_match() API to simplify pcre2demo, test, and substitute #733
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
Conversation
|
This is a good idea |
da3d047 to
0136d7e
Compare
|
PR description updated. I have polished the documentation, which I think is now clearer and more helpful. The improvement in readability in pcre2demo is very nice: clients can actually use this API without pain! The improved handling in pcre2_substitute is an extra bonus. I am finished with this now.
|
|
Zoltan, are you happy for me to merge this new API function? I want to make sure you have a chance to check/veto it. I'm happy to self-review the implementation, if you're OK with the API design. (I have also added a field to |
|
I haven't checked everything in detail, but I think this is a useful user function, and the patch looks good. The overhead of setting the |
|
Thank you very much Zoltan! |
Fixes #685
PCRE2 clients to iterate over matches, without needing an advanced knowledge
of regular expressions. The current amount of code, and comments, in
pcre2demo makes it look like we are placing a heavy burden on clients, when
we could take that burden away by providing a function to do the work for them.
implementations of the /g global match behaviour: pcre2demo, pcre2_substitute,
and pcre2test.
which makes several match attempts, swallows duplicate matches, and more.
We can have identical behaviour with a simple retry using
PCRE2_NOTEMPTY_ATSTART.
can inspect where the match attempt began, and ensure that the next attempt
advances through the subject.