//string regularExpressionPattern = @"\<(.*?)\>"; // FOR right angles < >
//string regularExpressionPattern = @"\((.*?)\)"; // FOR parenthesis ( )
//string regularExpressionPattern = @"\{(.*?)\}"; // FOR curly brackets { }
string regularExpressionPattern = @"\[(.*?)\]"; //FOR []
string inputText = "Find string inside brackets [test1] and [test2] in [ASP.net]";
Regex re = new Regex(regularExpressionPattern);
foreach (Match m in re.Matches(inputText))
{
//Put Your LOGIC
}
//string regularExpressionPattern = @"\((.*?)\)"; // FOR parenthesis ( )
//string regularExpressionPattern = @"\{(.*?)\}"; // FOR curly brackets { }
string regularExpressionPattern = @"\[(.*?)\]"; //FOR []
string inputText = "Find string inside brackets [test1] and [test2] in [ASP.net]";
Regex re = new Regex(regularExpressionPattern);
foreach (Match m in re.Matches(inputText))
{
//Put Your LOGIC
}
No comments:
Post a Comment