Skip to content
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

Duplicate names and callouts #17

Closed
AnFunctionArray opened this issue Sep 9, 2021 · 3 comments
Closed

Duplicate names and callouts #17

AnFunctionArray opened this issue Sep 9, 2021 · 3 comments

Comments

@AnFunctionArray
Copy link

I have a function that is searching for the nearest named group by name by measuring the distance from the nametable and last capture_last callout structure field.

It seems to be buggy.

Like how do I get the most recent (actually only one normally in the current subroutine) named group when duplicate names are allowed?

@PhilipHazel
Copy link
Collaborator

Duplicate names are most useful in patterns when only one of the duplicates can be set in any given match, for example, if each one is in a separate branch. If more than one is set, there is no direct way to tell which was most recent. I think the only way you could achieve this would be to make use of different (*MARK) items.

@AnFunctionArray
Copy link
Author

@PhilipHazel Thanks for the tip - how exactly would I achieve that?

@PhilipHazel
Copy link
Collaborator

Read the documentation about the pcre2_get_mark() function. I'm going to close this issue now.

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

No branches or pull requests

2 participants