Browse Source

Fix #717 - Why do regular expressions require //?

pull/728/merge
Siegfried Pammer 10 years ago
parent
commit
2a5546c458
  1. 8
      ILSpy/SearchStrategies.cs

8
ILSpy/SearchStrategies.cs

@ -21,8 +21,12 @@ namespace ICSharpCode.ILSpy @@ -21,8 +21,12 @@ namespace ICSharpCode.ILSpy
{
if (terms.Length == 1 && terms[0].Length > 2) {
var search = terms[0];
if (search.StartsWith("/", StringComparison.Ordinal) && search.EndsWith("/", StringComparison.Ordinal) && search.Length > 4)
regex = SafeNewRegex(search.Substring(1, search.Length - 2));
if (search.StartsWith("/", StringComparison.Ordinal) && search.Length > 4) {
var regexString = search.Substring(1, search.Length - 1);
if (regexString.EndsWith("/", StringComparison.Ordinal))
regexString = regexString.Substring(0, regexString.Length - 1);
regex = SafeNewRegex(regexString);
}
terms[0] = search;
}

Loading…
Cancel
Save