I have a series of expressions that start with numbers of different length and I would like to extract the string after these numbers: e.g. c(“14ac”, “148me3”) I would like to get c(“ac”, “me3).
I wrote this expression
xx <- c("14ac", "148me3")
str_extract(xx, "(?<=\d+).*")
but it doesn’t work because in stringr you need a limit on look behind length. I get the error:
Error in stri_extract_first_regex(string, pattern, opts_regex = opts(pattern)) :
Look-Behind pattern matches must have a bounded maximum length. (U_REGEX_LOOK_BEHIND_LIMIT, context=(?<=d+).*
)
Then I tried
xx <- c("14ac", "148me3")
str_extract(xx, "(?<=\d{1, 10}).*")
but this also doesn’t work
Error in stri_extract_first_regex(string, pattern, opts_regex = opts(pattern)) :
Error in {min,max} interval. (U_REGEX_BAD_INTERVAL, context=(?<=d{1, 10}).*
)
could anyone please let me know what is the correct way to write this?