I am trying to find a pattern inside a text string. the pattern I am trying to find is the $ sign, and then +2 words on each side.
this code worked for me when I used regular numbers, such as "million", but when I tryied the $ sign, it doesnt work.
here is the code below:
df <- read_xlsx("summary.xlsx")
df_check<-as.data.frame(stringr::str_extract_all(df$detail, utf8::as_utf8("(?:[^\\s]+\\s){2}$(?:\\s[^\\s]+){2}"),simplify = TRUE))
any help will be much appreciated,
thanks!