I would like to capture all mentions of "pensions" (capital-insensitive, including pensions, pensioners, but excluding unrelated words like "suspension." However, I would like to exclude pensions when they are preceded by "Department of Work and "; but I can't manage to capture the whole expression. So far I have:
sentences <- c("department of work and pensions", "and pensioners", "pensioners", "Pensions", "suspension")
try <- grepl("(?<!department of work and )^pension*", ignore.case = T, perl = T, sentences)
try
Any advice?