Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ internal static int MapCaptureNumber(int capnum, Hashtable? caps) =>
private static ReadOnlySpan<byte> Category =>
[
// 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F
0, 0, 0, 0, 0, 0, 0, 0, 0, W, W, 0, W, W, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, W, W, W, W, W, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
W, 0, 0, Z, S, 0, 0, 0, S, S, Q, Q, 0, 0, S, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Q,
// @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _
Expand All @@ -1939,7 +1939,7 @@ internal static int MapCaptureNumber(int capnum, Hashtable? caps) =>
];

private static readonly SearchValues<char> s_metachars =
SearchValues.Create("\t\n\f\r #$()*+.?[\\^{|");
SearchValues.Create("\t\n\v\f\r #$()*+.?[\\^{|");

/// <summary>Returns true for those characters that terminate a string of ordinary chars.</summary>
private static bool IsSpecial(char ch) => ch <= '|' && Category[ch] >= S;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ public static IEnumerable<object[]> Match_MemberData()
// "x" option. Removes unescaped whitespace from the pattern. : Actual - "\x20([^/]+)\x20","x"
yield return ("\x20([^/]+)\x20\x20\x20\x20\x20\x20\x20", " abc ", RegexOptions.IgnorePatternWhitespace, 0, 10, true, " abc ");

// "x" option. Vertical tab should be ignored as whitespace
if (!PlatformDetection.IsNetFramework)
{
yield return ("a\vb", "ab", RegexOptions.IgnorePatternWhitespace, 0, 2, true, "ab");
}

// Turning on case insensitive option in mid-pattern : Actual - "aaa(?i:match this)bbb"
if ("i".ToUpper() == "I")
{
Expand Down