Improve bad regex msg when doing Find/count - thx Janusz :)

This commit is contained in:
niksedk 2021-10-30 13:58:46 +02:00
parent d92cd06b00
commit e2b17ff4b3

View File

@ -414,7 +414,17 @@ namespace Nikse.SubtitleEdit.Logic
{
if (FindReplaceType.FindType == FindType.RegEx)
{
count += _regEx.Matches(p.Text).Count;
try
{
count += _regEx.Matches(p.Text).Count;
}
catch (RegexMatchTimeoutException exception)
{
MessageBox.Show(exception.Message + Environment.NewLine +
Environment.NewLine +
"Input: " + exception.Input);
return count;
}
}
else
{