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

Add helpers for str_match() #521

Closed
DanChaltiel opened this issue Aug 9, 2023 · 2 comments
Closed

Add helpers for str_match() #521

DanChaltiel opened this issue Aug 9, 2023 · 2 comments

Comments

@DanChaltiel
Copy link

Hi,

I really love the new helpers str_split_1() and str_split_i() from v1.5.0.

Would it be possible to have the same for str_match()?

Currently, there is no one-call way to extract a regex group from a character vector, as str_match() returns a matrix.
You can use matrix indexing but that is less readable (IMHO) and doesn't always play nice with pipes.

I can do a PR if this is accepted.

@hadley
Copy link
Member

hadley commented Oct 31, 2023

Are you looking for the group argument to str_extract()?

@hadley hadley closed this as completed Oct 31, 2023
@DanChaltiel
Copy link
Author

Indeed thanks and sorry for the useless issue then!

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