How can I parse a string into different strings in C#?
<p>I just started work on a C# application. I need to break down a string into different parts. Is there an easy way to do this using C# patterns? I think I can do it with substrings but it might get messy and I want to do something that's easy to understand. Here's an example of the input:</p>

<pre><code>AB-CDE-GHI-123-45-67-7777

variable1 = "AB-CDE-GHI"
variable2 = "123"
variable3 = "45"
variable4 = "67"
variable5 = "67-7777"

AB-CDE-GHIJKLM-123-45-67-7777

variable1 = "AB-CDE-GHIJKLM"
variable2 = "123"
variable3 = "45"
variable4 = "67"
variable5 = "67-7777"

AB-123-45-67-7777

variable1 = "AB"
variable2 = "123"
variable3 = "45"
variable4 = "67"
variable5 = "67-7777"
</code></pre>

<p>The first part of the string up until "123-45-67-7777" can be any length. Lucky for me the last part 123-45-67-7777 is always the same length and contains numbers that are zero padded. </p>

<p>I hope someone can come up with some suggestions for an easy method that uses regular expressions or something. </p>

<p>Input lines look like this:</p>

<pre><code>aa-123-45-67-7777
HJHJH-123-45-67-7777
H-H-H--123-45-67-7777
222-123-45-67-7777
</code></pre>
