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

Code Example 1

df1 %>% filter(!grepl("^x|xx$", fruit))

Learn ReactJs, React Native from akashmittal.com