XML regular expression

Hello Guys,

I need a proper regular expression when reading an XML file. I need to strip hidden and unwanted characters from the file.
Could you also please provide me with an example that cleans the whole file from these unwanted characters?

Thanks.

This will remove control characters except for return, linefeed, and tab. Is that what you’re looking for? (This is one of the free samples you can get for RegExRX, by the way.)

dim rx as new RegEx
rx.SearchPattern = "(?mi-Us)[\\x00\\cA-\\cH\\cK-\\cL\\cN-\\x1F]"
rx.ReplacementPattern = ""

dim rxOptions as RegExOptions = rx.Options
rxOptions.ReplaceAllMatches = true

dim replacedText as string = rx.Replace( sourceText )

Thanks Kem,

Your example seems to be working.