Could anyone explain what’s being replaced here?
I don’t know if enough information is present to understand what’s being searched and what’s being replaced:
regEx.Pattern = "(\s) *(\S)"
regEx.Global = True
that = regEx.Replace(that, "$1$2")
\sis a whitespace character, such as a tab or a space.\Sis any other character. So this preserves the first whitespace character and strips out all following spaces (specifically spaces, not any whitespace character) that occur before a printing character. I’m guessing maybe it’s to “clean” lines that use both tab and space indentation, though this seems like a pretty lousy way to do that.