tidyverse / stringr

A fresh approach to string manipulation in R

Home Page:https://stringr.tidyverse.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add helpers for `str_match()`

DanChaltiel opened this issue · comments

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.

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

Indeed thanks and sorry for the useless issue then!