I am looking for as way to test a given element in the source XML and remove characters that are not valid. Basically I have a list of allowed characters and need a way to repl
You can use replace()
as hinted above. Using your regular expression for valid characters, you could try this:
replace($string,"[^0-9a-zA-Z/\-\?:\(\)\.,'\+ \r\n]+","")
You can see that your regular expression is almost as it was, except that ^
has been added to turn the set of valid characters to its complement.