mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Merge pull request #862 from ivandrofly/idx
Minor refact for index checking
This commit is contained in:
commit
e5c2e57097
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user