Here it is :
string pattern = @"^\s*Method1\s*\(\s*(\d+)\s*,\s*([^)]*)\)(\s*\'.*)?\s*$";
Regex regex = new Regex(pattern, RegexOptions.Multiline);
string input = " Method1( 100, variable1) 'comm 23 ";
var matches = regex.Matches(input);
foreach (Match match in matches)
{
Console.WriteLine(match.Value);
foreach (Group group in match.Groups)
{
Console.WriteLine(" >" + group.Value);
}
}
Groups are created by embracing parts of pattern with parentheses so manipulate groups so that fits your needs.
Hope it helps.