Sample String
Apple, Pinapple, NONE\nOrange, Pears, Apples\nMango, None, Banana\nLemon, NONEDLE, Grape
Regex I have tried
(?<=\\n)(.*?)(?=\\n)
- This matches each of the substrings, but I could not figure out how to only match the ones with NONE in them
Desired result
I have tried to build a regex that will match each of the lines in the sample string (a line being between one \n to another). However, I would like it to only match if that line contains the word NONE as a whole word. I have tried to reverse engineer the result from Regex Match text within a Capture Group but wasn't able to get far.
I'm writing a java method that should remove parts of the string that match the regex.
Any help would be appreciated!!!