Check out example codes for "filter grepl r". It will help you in understanding the concepts better.

Code Example 1

df1 %>% filter(!grepl("^x|xx$", fruit))
###
    fruit group
1   apple     A
2  orange     B
3 banxana     A
4 appxxle     B

Learn ReactJs, React Native from akashmittal.com