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

Implement captured API to avoid reNonCapture usage #124

Open
nitely opened this issue Aug 13, 2023 · 0 comments
Open

Implement captured API to avoid reNonCapture usage #124

nitely opened this issue Aug 13, 2023 · 0 comments
Labels

Comments

@nitely
Copy link
Owner

nitely commented Aug 13, 2023

Doing text[group(m, x)] for both empty-match/non-match returns an empty string. The current way to check if group(m, x) matched is to do group(m, x) != reNonCapture. I think it would be better to provide a captured(m, x) API which internally just does group(m, x) != reNonCapture.

There is probably a better API name. Maybe wasCaptured

@nitely nitely added the design label Aug 13, 2023
@nitely nitely changed the title Implement captured API to avoid reNonCapture magic value Implement captured API to avoid reNonCapture usage Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant