I have a regex expression that I'm doing a split against another string and I'm getting weird results.
string subjectString = "Triage|Follow Up|QA";
string[] splitArray = null;
try
{
splitArray = System.Text.RegularExpressions.Regex.Split(subjectString, @"(?<=(^|[^\\]))\|");
foreach (var item in splitArray)
{
System.Diagnostics.Debug.Print(item);
}
}
catch
{
}
The items being printed are:
Triage
e
Follow Up
p
QA
The regex behaves correctly in RegexBuddy, but not in C#. Any ideas on what's causing the weird behavior? Extra points for explaining why the split function is acting the way it is.