I am currently doing a project in my Java class which involves scanning a text file and then breaking each line up with java regular expressions. An example of the one of the lines in the text file is shown below:
I have been trying to break this up so that I can get the word phases like "Ultra Liquid Bleach" and "Mountain Fresh" but not the white spaces in between. My current code that I have so far is:
([\\w]+|[ ]?)\\b
and I cannot get any farther than that. The first two words vary in number of words so any expression that targets a specific number of words will not work. Am I on the right track or is there a better way of doing what I am trying to do?