I have built a tool that redacts text based on patterns. I use this to remove sensitive information like social security numbers, credit cards, etc. I am currently using this for HTML files.
Typically I just replace the text with the “X” character. Instead of a “X” I am looking to use some type of Square character (I am thinking of just a black box). I am not able to figure out how to do this for HTML files.
currentRegularExpressionsToSearch.redactionAsciCode = 88; //This is the asci code for an “X”, I want to do a square instead.
//This statement does the replace.
currentFileText = Regex.Replace(currentFileText, redactString, new String((char)currentRegularExpressionsToSearch.redactionAsciCode, redactString.Length));
Does anyone know if this is possible? Hopefully what I am looking to do makes sense.