I have some data in this form:
@"Managers Alice, Bob, Charlie
Supervisors Don, Edward, Francis"
I need a flat output as follows:
@"Managers Alice
Managers Bob
Managers Charlie
Supervisors Don
Supervisors Edward
Supervisors Francis"
The actual "job title" above can be any one word, there can be no discrete list from it.
Replacing , with is \r\nquite simple, like the first replacement:
Replace (^|\r\n)(\S+\s)([^,\r\n]*),\s
With $1$2$3\r\n$2
But capturing other names and applying the same prefix is ββwhat eludes me today. Any suggestions?
I am only looking for one or more calls RegEx.Replace(), without any LINQ or C # procedural code, which, of course, would be trivial. Implementing not directly in C # code, I am setting up a general parsing tool that uses a number of .NET regular expressions to convert incoming data from different sources for several purposes.