Regex 如何用R码找出句子中的连续词

Regex 如何用R码找出句子中的连续词,regex,r,Regex,R,如何用R码找出句子中的连续词 例如: 下面有一句话,是下面的输出 sentence <- text[grep("Guarantee of",text)] 句子句子试试看 或 数据 str1 sentence <- 'You are requested to submit the Performance Guarantee of Rs.13,863.00/-( Rupees thirteen thousand and eight sixty three)'; sub('.*Guara

如何用R码找出句子中的连续词

例如:

下面有一句话,是下面的输出

sentence <- text[grep("Guarantee of",text)]
句子
句子试试看

数据
str1
sentence <- 'You are requested to submit the Performance Guarantee of Rs.13,863.00/-( Rupees thirteen thousand and eight sixty three)';
sub('.*Guarantee\\s+of\\s+([a-zA-Z0-9,._/-]+).*','\\1',sentence);
## [1] "Rs.13,863.00/-"
gsub('.*Guarantee of\\s*|\\(.*', '', str1)
[1] "Rs.13,863.00/-"
library(stringr)
str_extract(str1, '(?:Rs.)[^(]+')
#[1] "Rs.13,863.00/-"
  str1 <- "You are requested to submit the Performance Guarantee of Rs.13,863.00/-( Rupees thirteen thousand and eight sixty three)"