"Tom" <nf*@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a poitionally delimited flat file (.txt) with large records being
prepared for uploading to a mainframe. I need to make sure that any
invalid characters within fields are translated into spaces. It seems as though
RegEx might be most appropriate for this.
Does anyone know the RegEx syntax?
The character class \W matches "any nonword character" - anything that is
not a-z, A-Z, or 0-9. So:
string foo = "hey!fix?this";
string bar = System.Text.RegularExpressions.Regex.Replace(foo, @"\W", "
");
You can buy a book, but I think the MSDN documentation on regular
expressions is pretty good.
Erik