I have the following text
"a|mother" "b|father"
I want to find via Regex, groups of text that starts with '"'
and ends with '"'
and separate with '|'
without spaces. Meaning the results would be:
"a|mother"
"b|father"
How can I find the |? and how can I find my pattern without spaces?
Something like this:
String source = "\"a|mother\" \"b|father\"";
var result = Regex
.Matches(source, "\"[^\"]*[^ ]\\|[^ ][^\"]*\"")
.OfType<Match>();
Console.Write(String.Join(Environment.NewLine, result));
Output is
"a|mother"
"b|father"