public ArgvParser(string args)
{
Regex Extractor = new Regex(@"(['""][^""]+['""])\s*|([^\s]+)\s*",
RegexOptions.Compiled);
MatchCollection matches;
string[] parts;
// Get matches (first string ignored because
// Environment.CommandLine starts with program filename)
matches = Extractor.Matches (args);
parts = new string[matches.Count - 1];
for (int i = 1; i < matches.Count; i++)
{
parts[i-1] = matches[i].Value.Trim ();
}
}