I am currently trying to make use of the java string function someString.replaceAll()
to find commonly used words (and, the, by, of, etc) and replace them with " "
. Based on the answers to the question at Whitespace Matching Regex - Java, I produced this function call:
data.replaceAll("(?i)\\sthe\\s", " ")
However, it isnt working and I'm really not sure why. Nothing about it looks wrong based on what I've found. Please help me!