c# regex extract string between brackets code example
Example 1: c# regex to find number between parenthesis
Regex.Match("User name (sales)", @"\(([^)]*)\)").Groups[1].Value
Example 2: c# regex extract string between brackets
string input = "User name [sales]";
string output = input.Split('(', ')')[1];
Example 3: c# get string in parentheses
string input = "User name (sales)";
string output = input.Split('(', ')')[1];