It looks like you're trying to do set subtraction, but that isn't how it's done. Instead, you have to use the intersection operator, &&, with a negated character class. For example, if you wanted to match any punctuation character except a period or plus sign, you would use
But for your puropose, I don't think you need anything so elaborate. If you want to match any
word character or plus sign or period, just say that directly:
(BTW, this intersection notation is unique to the java.util.regex package.)