I have this word, "sam buy expensive toys as 125898652"
.
I would like to extract the word after "as", which is "125898652".
I'm using
(?<=as\s)+[^\s]+
I've tried it on https://regex101.com/r/NaWAl1/1 and it works pretty well. when i execute it on R it returning error as
Error: '\s' is an unrecognized escape in character string starting ""(?<='as'\s"
So I modify it to
(?<='CR'\s)+[^\s]+
It returning different error as :
Error in stri_extract_first_regex(string, pattern, opts_regex = opts(pattern)) :
Syntax error in regexp pattern. (U_REGEX_RULE_SYNTAX)
Can someone please explain it to me why regex different in R and how to make it works. Thank you so much