title: Regex to parse function and parameters
body: <p>I have the following string:</p>
  
  <pre><code>function(param1, param2, param3, param4, ..., paramN)
  </code></pre>
  
  <p>I need a Regex code to parse it as an array of strings:</p>
  
  <pre><code>function
  param1
  param2
  param3
  param4
  .
  .
  .
  paramN
  </code></pre>
  
  <p>I've tried several examples in the net but none of them seems to work for me.</p>
  
  <p>[EDIT]</p>
  
  <p>Not woking with the suggestion. Check the above code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Text.RegularExpressions;
  
  namespace TestRegex
  {
      class Program
      {
          static void Main(string[] args)
          {
              string Expression = String.Empty;
  
              while (Expression.Trim() != "EXIT")
              {
                  Expression = Console.ReadLine();
  
                  ///
                  /// Get function name
                  /// 
                  var funcTags = Regex.Matches(Expression, @"b[^()]+\((.*)\)$");
  
                  Console.WriteLine("Matches: " + funcTags.Count);
                  foreach (var item in funcTags)
                      Console.WriteLine("FuncTag: " + item);
  
                  ///
                  /// Get parameters
                  /// 
                  var paramTags = Regex.Matches(Expression, @"\b[^()]+\((.*)\)$");
  
                  Console.WriteLine("Matches: " + paramTags.Count);
                  foreach (var item in paramTags)
                      Console.WriteLine("ParamTag: " + item);
              }
          }
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>function("a", "b", "c");
  Matches: 0
  Matches: 0
  </code></pre>
  
  <p>Something is wrong here... Appreciate help.</p>