Having a slight regex problem. I wrote to following code to check if a word is contained within a String.
boolean matches = Pattern.matches("\\b" + Pattern.quote(item.name) + "\\b", nap.code);
item.name will be something like "half" nap.code will be something like "int halfOfFour() { return half(4); }"
Yet, my pattern match returns false... What am I doing wrong here?
Also... Is there anyway to make this return false if the word is contained within a string?