Q:

Regex Split String at particular word

I would like to use the .net Regex.Split method to split this input string into an array. It must group the word.
Input: **AAA**-1111,**AAA**-666,**SMT**-QWQE,**SMT**-TTTR
Expected output:
**AAA** : 1111,666

**SMT** : QWQE,TTTR

What pattern do I need to use?

A:

As the comment on the question notes, you cannot do this in a single step (regex or not).
So:

Split on commas.
Split on dash (but keep the pairs)
Group by the first part of each pair.

Something like:
var result = select outer in input.Split(",")
             let p = outer.Split('-')  // will be string[2]
             select new { identifier = p[0], value = p[1] }
             into pair
             group by pair.identifier into g
             select new {
               identifier = g.Key
               values = String.Join(",", g)
             }

