I'm trying to use regex to extract a string, it works here: https://regexr.com/3vsd4
But when running something similar in R it fails:
m = "(?<=~* )([ AP_])\\w+"
x = "XY_O ~ R_Z + YPP_L_WINTER + AP_C"
str_match(x, m)[1, 1]
Gives the error:
Error in stri_match_first_regex(string, pattern, opts_regex = opts(pattern)) : Look-Behind pattern matches must have a bounded maximum length. (U_REGEX_LOOK_BEHIND_LIMIT)
How can I edit the R
code to return "AP_C"
?