Using DirectoryServices.AccountManagement I'm getting users `DistinguishedName` which looks like so:

```
CN=Adam West,OU=STORE,OU=COMPANY,DC=mycompany,DC=group,DC=eu

```

I need to get first `OU` value from this.  

I found similar solution: [C# Extracting a name from a string](https://stackoverflow.com/questions/356480/c-sharp-extracting-a-name-from-a-string)

And using some tweaks I created this code:

```
string input = @"CN=Adam West,OU=STORE,OU=COMPANY,DC=mycompany,DC=group,DC=eu";
Match m = Regex.Match(input, @"OU=([a-zA-Z\\]+)\,.*$");
Console.WriteLine(m.Groups[1].Value);

```

This code returns `STORE` as expected, but if I change `Groups[1]` to `Groups[0]` I get almost same result as input string:

```
OU=STORE,OU=COMPANY,DC=mycompany,DC=group,DC=eu

```

How can I change this regex so it will return only values of `OU`? SO that in this example I get array of 2 matches. If I would have more OU in my string then array would be longer.

**EDIT:**
I've converted my code (using @dasblinkenlight suggestions) into function:

```
private static List<string> GetOUs()
{
    var input = @"CN=Adam West,OU=STORE,OU=COMPANY,DC=mycompany,DC=group,DC=eu";
    var mm = Regex.Matches(input, @"OU=([a-zA-Z\\]+)");
    return (from Match m in mm select m.Groups[1].Value).ToList();
}

```

Is that correct?