I have a problem that I want a regex pattern that allows every character, for example, alphabets , digits, special characters, umlaut characters but not invalid ones like an arrow sign which prevents me from generating a xml. Please help me with this and how can I replace that invalid character with a white space.? I am using java 1.5