regextr: regextr: Substring Extraction By Regular Expression

Description Usage Arguments Value Author(s)

View source: R/regextr.R

Description

Extract substring(s) that match a regular expression in a character vector

Usage

1
regextr(pattern, x, L.trim = 0, R.trim = 0, ...)

Arguments

pattern

character string specifying regular expression to be matched

x

string or character vector of strings to be searched

L.trim

integer; number of characters to strip from the start of the matched substring

R.trim

integer; number of characters to strip from the end of the matched substring

...

other arguments passed to regexpr()

Value

matched: a character vector the same length as x containing substrings of that match the pattern. Only the first match found is returned. If no match is found, an empty string ("") is returned in that element.

Author(s)

M.W.Rowe, mwr.stats@gmail.com


mwrowe/microRutils documentation built on June 12, 2021, 2:41 p.m.