I have this text file that I read into a Java application and then count the words in it line by line. Right now I am splitting the lines into words by a
St
Well, seeing you want to count can't as two words , try
split("\\b\\w+?\\b")
http://www.regular-expressions.info/wordboundaries.html