I receive rather long XML strings as output from a third party and some of the fields represented in the XML may contain credit card numbers. I do not know the node/element/attribute names ahead of time. What would be the simplest method for finding and replacing card numbers with a placeholder in C#? String functions? Regex?
Edit: I think I'm going to do something like this:
Match m = Regex.Match(xml, ">[0-9]{16}<");
xml = xml.Replace(m.Value, ">FOOBAR<");
Checking for exceptions if the string doesn't exist of course. I think this, possibly combined with a checksum algorithm, will be sufficient for my needs
Thank you for the replies.