MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #14822] match() analogue for regexes, eg firstgrep() or match( , regex=TRUE) #4411

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

It would be a great speeder-upper to have something like grep() that only returns the first match (if there is one). If it could work like match() and take a vector of regexes as its pattern argument, and return the first-matching-position for each, that'd be even nicer. The point is to avoid wasting cycles when only the first match is required.

R's regex and text-manipulation facilities are very good these days; eg I find it very useful for automatically manipulating low-level programming code. Often I only need the first line that greps to some pattern, but grep() etc look thru the entire object.


METADATA

github-actions[bot] commented 4 years ago

NA


METADATA

github-actions[bot] commented 4 years ago

NA


METADATA

github-actions[bot] commented 4 years ago

NA


METADATA

github-actions[bot] commented 4 years ago

NA


METADATA