Skip to content

Expose group_info() for Regex::Captures #1238

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

Closed
wesleyel opened this issue Nov 12, 2024 · 1 comment
Closed

Expose group_info() for Regex::Captures #1238

wesleyel opened this issue Nov 12, 2024 · 1 comment
Labels

Comments

@wesleyel
Copy link

wesleyel commented Nov 12, 2024

Hi there!

I'm writing a wrapper for regex crate's Regex::Captures struct, and for this I need to get the group_info member of regex_automata::util::captures::Captures.

But I found that the Regex::Captures type currently does not have a way to export its caps attribute or the group_info() method of the caps attribute.

Would regex willing to accept a patch that expose group_info()? Or Maybe I should head to use regex_automata?

Thanks!

@BurntSushi
Copy link
Member

You can't just expose GroupInfo. That would make regex-automata a public dependency of regex, which it is very intentionally and very carefully not. So to do that, we'd need to make a wrapper type for it.

In general, I do not expand the API of regex without good reason, and I don't see any motivating examples here to argue in favor of that direction.

Yes, you should be using regex-automata.

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

2 participants