Merge pull request #862 from ivandrofly/idx

Minor refact for index checking
This commit is contained in:
Nikolaj Olsson 2015-06-14 21:09:46 +02:00
commit e5c2e57097

View File

@ -2059,12 +2059,12 @@ namespace Nikse.SubtitleEdit.Logic
public static string GetRegExGroup(string regEx)
{
int start = regEx.IndexOf("(?<", StringComparison.Ordinal);
if (start >= 0 && regEx.IndexOf(')') > start)
if (start >= 0 && regEx.IndexOf(')', start + 3) > start)
{
start += 3;
int end = regEx.IndexOf('>', start);
if (end > start)
{
start += 3;
return regEx.Substring(start, end - start);
}
}