title: How to check the arguments with Regex?
body: <p>I'm stuck with regular expressions. The program is a console application written in C#. There are a few commands. I want to check the arguments are right first. I thought it'll be easy with Regex but couldn't do that:</p>
  
  <pre><code>var strArgs = "";
  
  foreach (var x in args)
  {
      strArgs += x + " ";
  }
  if (!Regex.IsMatch(strArgs, @"(-\?|-help|-c|-continuous|-l|-log|-ip|)* .{1,}"))
  {
      Console.WriteLine("Command arrangement is wrong. Use \"-?\" or \"-help\" to see help.");
      return;
  }
  </code></pre>
  
  <p>Usage is:</p>
  
  <pre><code>program.exe [-options] [domains]
  </code></pre>
  
  <p>The problem is, program accepts all commands. Also I need to check "-" prefixed commands are before the domains. I think the problem is not difficult to solve.</p>
  
  <p>Thanks...</p>