I am new to regex in R. Here I have a vector where I am interested in extracting the first occurance of a number in each string of the vector .
I have a vector calle
R's regmatches() method returns a vector with the first regex match in each element:
regmatches()
regmatches(shootsummary, regexpr("\\d+", shootsummary, perl=TRUE));