Tool C# Regular Expression
Документация:
Код через regex.Matches
Спойлер
string allText = richTextBox1.Text;
string pattern = textBox2.Text;
string s = string.Empty;
try
{
Regex regex = new Regex(pattern);
MatchCollection matches = regex.Matches(allText);
if (matches.Count > 0)
{
foreach (Match match in matches)
s += match.Value + ";\r\n";
}
else
{
s = "Совпадений не найдено";
}
textBox3.Text = s;
} catch (Exception) {
//throw;
}
-
2
3 Комментария
Рекомендуемые комментарии
Пожалуйста, войдите, чтобы комментировать
Вы сможете оставить комментарий после входа в
Войти