substri() splits each element in 'x' into substrings and returns the desired substring(s). 'sep' defines the delimiters separating the strings into substrings, such that the input data between the matches become the fields themselves. 'pos' defines the substring index(es) to be returned.
substri(x, sep = "\\.|-|_", pos = 1, max.nchar = NULL, na.rm = TRUE)
A character vector.
The pattern to split each element of 'x' by. Default: '\.|-|_'
The substring index(es) to be returned. Default: 1
'NULL', or a maximum number of characters that the substrings should be trimmed to contain. Default: NULL
Remove NA substring positions. Default: TRUE
A character vector containing the extracted substrings.