Basically, I want to use regular expressions to return false if the string contains "word" AND is followed by a number, i.e. returning false if "theword1", "theword2", "theword5" etc.
However, I still want it to return true if it is just "theword" without a number or a completely different string like "apple5" - the word and number have to be together to return false. I know it can be done but I really am stuck.
Here is what I've tried so far (doesn't work):
str.matches(".*([word][^1-9])*.*")
My logic was 0 or more characters (.*) word NOT next to a number occurring 0 or more times (([word][^1-9])*) and then 0 or more characters afterwards.