c# get string that matches using regex code example
Example 1: c# regex get matched string
Regex filter = new Regex(@"(\d+)");
foreach (var item in checkedListBox1.CheckedItems)
{
var match = filter.Match(item.ToString());
if (match.Success)
{
MessageBox.Show(match.Value);
}
}
Example 2: c# regex match
var regex = new Regex(@"(?<=%download%#)\d+");
return regex.Matches(strInput);