I've got this array of paragraphs. I need to see if a specific word is in the array by using Regex. I'm new to regex and so far I've tried
claims.forEach((d) => {
const regexp = /[protein]+/i
const result = d.match(regexp)
console.log(result)
})
However this returns every occurrence of the word "protein" even if its first 3 letters.
How would I take out any occurrence of not just protein, but a list of words using Regex?
this is the array:
["UPDATE | Due to high demand, please allow extra time for your delivery Dismiss", "HIGH IN PROTEIN & FIBRE", "<160 CALORIES", "GLUTEN & PALM OIL FREE", "NUT BUTTER FILLED", "This nutty, chewy ball with a salty kick is danger…ng or afternoon, to satisfy those sweet cravings.", "High in Protein & Fibre", "<160 Calories", "Gluten & Palm Oil Free", "Nut Butter Filled", "Packed with protein, full of fibre and nutritional…erfect pick me up to energise and keep you going!", "158kcal\n9.2g Protein\nVegetarian\nGluten Free\nPalm Oil Free\nHigh in Fibre", "Almonds (26%), Cashews (18%), Brown Rice Syrup, Wh…vourings, Antioxidant: Natural Mixed Tocopherols.", " ", " Kosher", "VEGAN", "VEGAN", "By signing up to our newsletter, you agree for you…rselves regarding Bounce Brands and its partners.", "Fuelling your day the natural way!"]