Updated on Kisan Patel
Problem:
How to find a string included between two characters?
Looping through Regex Matches
How to use Regex to get the string between curly braces using C#?
Solution:
string ch = "Match a {single} character {present} in the list below"; Regex ItemRegex = new Regex(@"{(.*?)}", RegexOptions.Compiled); foreach (Match ItemMatch in ItemRegex.Matches(ch)) { Console.WriteLine(ItemMatch); }