From a44c853cac30474814a552a84e1b4814b02c50bb Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Wed, 15 Jul 2020 23:29:01 -0700 Subject: [PATCH 1/2] Unit test --- .../System.Text.RegularExpressions/tests/Regex.Match.Tests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs b/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs index 9ae78f8f91d2bb..aec0b8ccd8e22b 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs @@ -15,6 +15,8 @@ public class RegexMatchTests public static IEnumerable Match_Basic_TestData() { // pattern, input, options, beginning, length, expectedSuccess, expectedValue + yield return new object[] { @"H#", "#H#", RegexOptions.IgnoreCase, 0, 3, true, "H#" }; // https://github.com/dotnet/runtime/issues/39390 + yield return new object[] { @"H#", "#H#", RegexOptions.None, 1, 2, true, "H#" }; // Testing octal sequence matches: "\\060(\\061)?\\061" // Octal \061 is ASCII 49 ('1') From f6534191bf86ccc99afe41fa8532242d3a36e12b Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Wed, 15 Jul 2020 23:32:12 -0700 Subject: [PATCH 2/2] Fix --- .../src/System/Text/RegularExpressions/RegexCompiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs index b26a627a8cf2e9..2733536bdbd57a 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs @@ -1337,7 +1337,7 @@ protected void GenerateFindFirstChar() // ch = runtext[runtextpos]; // if (ch == lastChar) goto partialMatch; Rightchar(); - if (_boyerMoorePrefix.CaseInsensitive && ParticipatesInCaseConversion(chLast)) + if (_boyerMoorePrefix.CaseInsensitive) { CallToLower(); }