Check this pattern:
(?<=\t|^)[^\t]+?\|\|[^\t]+?\|\|[^\t]+?(?=\t|$)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a line of text like this:
<tab>some text<tab>some more text<tab>one||two||three<tab>more text<tab>red||green||blue
I want to find the indexes at the bolded o and r.
My attempt would be if possible:
pattern = @"(?<=\t.*)\|\|"
foreach (Match match in Regex.Matches(text, pattern)
Console.WriteLine("Found '{0}' at position {1}", match.Value, match.Index);
Even better would be to match the entire contents of the fields:
one||two||three and red||green||blue
Thanks for your assistance
Check this pattern:
(?<=\t|^)[^\t]+?\|\|[^\t]+?\|\|[^\t]+?(?=\t|$)