I have text file with a row like this:
SendersTimeSeriesIdentification: COMPANY_A/COMPANY_B/REF_7/20090505
I'd like to replace all non-word chars in the value part with the character n
, like this:
SendersTimeSeriesIdentification: COMPANYnAnCOMPANYnBnREFn7n20090505
But there are similar strings all over the file, which must remain intact. An example being:
MessageIdentification: REF_7/VER_1/20090505
I think I must use lookbehind, and I came to this attempt (VB.NET):
Regex.Replace(fileContentString, "(?<=SendersTimeSeriesIdentification: )(\W)", "0")
This doesn't work as I'd like it to. So my questions are:
Is it possible to replace all non-word characters in a specific piece of string with just one Regex.Replace call? How?