File: Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs
Project: ..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Microsoft.Extensions.AI.Abstractions.csproj (Microsoft.Extensions.AI.Abstractions)
// <auto-generated/>
#nullable enable
#pragma warning disable CS0162 // Unreachable code
#pragma warning disable CS0164 // Unreferenced label
#pragma warning disable CS0219 // Variable assigned but never used
 
namespace Microsoft.Extensions.AI
{
    partial class ChatResponseFormat
    {
        /// <remarks>
        /// Pattern:<br/>
        /// <code>[^0-9A-Za-z_]</code><br/>
        /// Explanation:<br/>
        /// <code>
        /// ○ Match a character in the set [^0-9A-Z_a-z].<br/>
        /// </code>
        /// </remarks>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
        private static partial global::System.Text.RegularExpressions.Regex InvalidNameCharsRegex() => global::System.Text.RegularExpressions.Generated.InvalidNameCharsRegex_0.Instance;
    }
}
 
namespace Microsoft.Extensions.AI
{
    partial class AIFunctionFactory
    {
        /// <remarks>
        /// Pattern:<br/>
        /// <code>^\\s*        # Optional whitespace at the start of the string\r\n   ( null   # null literal\r\n   | false  # false literal\r\n   | true   # true literal\r\n   | -?[0-9]# number\r\n   | "      # string\r\n   | \\[     # start array\r\n   | {      # start object\r\n   | //     # Start of single-line comment\r\n   | /\\*    # Start of multi-line comment\r\n   )</code><br/>
        /// Options:<br/>
        /// <code>RegexOptions.IgnorePatternWhitespace</code><br/>
        /// Explanation:<br/>
        /// <code>
        /// ○ Match if at the beginning of the string.<br/>
        /// ○ Match a whitespace character atomically any number of times.<br/>
        /// ○ 1st capture group.<br/>
        ///     ○ Match with 7 alternative expressions, atomically.<br/>
        ///         ○ Match the string "null".<br/>
        ///         ○ Match the string "false".<br/>
        ///         ○ Match the string "true".<br/>
        ///         ○ Match a sequence of expressions.<br/>
        ///             ○ Match '-' atomically, optionally.<br/>
        ///             ○ Match a character in the set [0-9].<br/>
        ///         ○ Match a character in the set ["[{].<br/>
        ///         ○ Match the string "//".<br/>
        ///         ○ Match the string "/*".<br/>
        /// </code>
        /// </remarks>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
        private static partial global::System.Text.RegularExpressions.Regex PotentiallyJsonRegex() => global::System.Text.RegularExpressions.Generated.PotentiallyJsonRegex_1.Instance;
    }
}
 
namespace Microsoft.Extensions.AI
{
    partial class AIFunctionFactory
    {
        /// <remarks>
        /// Pattern:<br/>
        /// <code>^&lt;([^&gt;]+)&gt;\\w__(.+)</code><br/>
        /// Explanation:<br/>
        /// <code>
        /// ○ Match if at the beginning of the string.<br/>
        /// ○ Match '&lt;'.<br/>
        /// ○ 1st capture group.<br/>
        ///     ○ Match a character other than '&gt;' atomically at least once.<br/>
        /// ○ Match '&gt;'.<br/>
        /// ○ Match a word character.<br/>
        /// ○ Match the string "__".<br/>
        /// ○ 2nd capture group.<br/>
        ///     ○ Match a character other than '\n' atomically at least once.<br/>
        /// </code>
        /// </remarks>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
        private static partial global::System.Text.RegularExpressions.Regex CompilerGeneratedNameRegex() => global::System.Text.RegularExpressions.Generated.CompilerGeneratedNameRegex_2.Instance;
    }
}
 
namespace Microsoft.Extensions.AI
{
    partial class AIFunctionFactory
    {
        /// <remarks>
        /// Pattern:<br/>
        /// <code>[^0-9A-Za-z]+</code><br/>
        /// Explanation:<br/>
        /// <code>
        /// ○ Match a character in the set [^0-9A-Za-z] atomically at least once.<br/>
        /// </code>
        /// </remarks>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
        private static partial global::System.Text.RegularExpressions.Regex InvalidNameCharsRegex() => global::System.Text.RegularExpressions.Generated.InvalidNameCharsRegex_3.Instance;
    }
}
 
namespace System.Text.RegularExpressions.Generated
{
    using System;
    using System.Buffers;
    using System.CodeDom.Compiler;
    using System.Collections;
    using System.ComponentModel;
    using System.Globalization;
    using System.Runtime.CompilerServices;
    using System.Text.RegularExpressions;
    using System.Threading;
 
    /// <summary>Custom <see cref="Regex"/>-derived type for the InvalidNameCharsRegex method.</summary>
    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
    file sealed class InvalidNameCharsRegex_0 : Regex
    {
        /// <summary>Cached, thread-safe singleton instance.</summary>
        internal static readonly InvalidNameCharsRegex_0 Instance = new();
    
        /// <summary>Initializes the instance.</summary>
        private InvalidNameCharsRegex_0()
        {
            base.pattern = "[^0-9A-Za-z_]";
            base.roptions = RegexOptions.None;
            ValidateMatchTimeout(Utilities.s_defaultTimeout);
            base.internalMatchTimeout = Utilities.s_defaultTimeout;
            base.factory = new RunnerFactory();
            base.capsize = 1;
        }
            
        /// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary>
        private sealed class RunnerFactory : RegexRunnerFactory
        {
            /// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary>
            protected override RegexRunner CreateInstance() => new Runner();
        
            /// <summary>Provides the runner that contains the custom logic implementing the specified regular expression.</summary>
            private sealed class Runner : RegexRunner
            {
                /// <summary>Scan the <paramref name="inputSpan"/> starting from base.runtextstart for the next match.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                protected override void Scan(ReadOnlySpan<char> inputSpan)
                {
                    if (TryFindNextPossibleStartingPosition(inputSpan))
                    {
                        // The search in TryFindNextPossibleStartingPosition performed the entire match.
                        int start = base.runtextpos;
                        int end = base.runtextpos = start + 1;
                        base.Capture(0, start, end);
                    }
                }
        
                /// <summary>Search <paramref name="inputSpan"/> starting from base.runtextpos for the next location a match could possibly start.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                /// <returns>true if a possible match was found; false if no more matches are possible.</returns>
                private bool TryFindNextPossibleStartingPosition(ReadOnlySpan<char> inputSpan)
                {
                    int pos = base.runtextpos;
                    
                    // Empty matches aren't possible.
                    if ((uint)pos < (uint)inputSpan.Length)
                    {
                        // The pattern begins with a character in the set [^0-9A-Z_a-z].
                        // Find the next occurrence. If it can't be found, there's no match.
                        int i = inputSpan.Slice(pos).IndexOfAnyExcept(Utilities.s_asciiWordChars);
                        if (i >= 0)
                        {
                            base.runtextpos = pos + i;
                            return true;
                        }
                    }
                    
                    // No match found.
                    base.runtextpos = inputSpan.Length;
                    return false;
                }
            }
        }
 
    }
    
    /// <summary>Custom <see cref="Regex"/>-derived type for the PotentiallyJsonRegex method.</summary>
    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
    file sealed class PotentiallyJsonRegex_1 : Regex
    {
        /// <summary>Cached, thread-safe singleton instance.</summary>
        internal static readonly PotentiallyJsonRegex_1 Instance = new();
    
        /// <summary>Initializes the instance.</summary>
        private PotentiallyJsonRegex_1()
        {
            base.pattern = "^\\s*        # Optional whitespace at the start of the string\r\n   ( null   # null literal\r\n   | false  # false literal\r\n   | true   # true literal\r\n   | -?[0-9]# number\r\n   | \"      # string\r\n   | \\[     # start array\r\n   | {      # start object\r\n   | //     # Start of single-line comment\r\n   | /\\*    # Start of multi-line comment\r\n   )";
            base.roptions = RegexOptions.IgnorePatternWhitespace;
            ValidateMatchTimeout(Utilities.s_defaultTimeout);
            base.internalMatchTimeout = Utilities.s_defaultTimeout;
            base.factory = new RunnerFactory();
            base.capsize = 2;
        }
            
        /// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary>
        private sealed class RunnerFactory : RegexRunnerFactory
        {
            /// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary>
            protected override RegexRunner CreateInstance() => new Runner();
        
            /// <summary>Provides the runner that contains the custom logic implementing the specified regular expression.</summary>
            private sealed class Runner : RegexRunner
            {
                /// <summary>Scan the <paramref name="inputSpan"/> starting from base.runtextstart for the next match.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                protected override void Scan(ReadOnlySpan<char> inputSpan)
                {
                    // The pattern is anchored.  Validate the current position and try to match at it only.
                    if (TryFindNextPossibleStartingPosition(inputSpan) && !TryMatchAtCurrentPosition(inputSpan))
                    {
                        base.runtextpos = inputSpan.Length;
                    }
                }
        
                /// <summary>Search <paramref name="inputSpan"/> starting from base.runtextpos for the next location a match could possibly start.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                /// <returns>true if a possible match was found; false if no more matches are possible.</returns>
                private bool TryFindNextPossibleStartingPosition(ReadOnlySpan<char> inputSpan)
                {
                    int pos = base.runtextpos;
                    
                    // Empty matches aren't possible.
                    if ((uint)pos < (uint)inputSpan.Length)
                    {
                        // The pattern leads with a beginning (\A) anchor.
                        if (pos == 0)
                        {
                            return true;
                        }
                    }
                    
                    // No match found.
                    base.runtextpos = inputSpan.Length;
                    return false;
                }
        
                /// <summary>Determine whether <paramref name="inputSpan"/> at base.runtextpos is a match for the regular expression.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                /// <returns>true if the regular expression matches at the current position; otherwise, false.</returns>
                private bool TryMatchAtCurrentPosition(ReadOnlySpan<char> inputSpan)
                {
                    int pos = base.runtextpos;
                    int matchStart = pos;
                    char ch;
                    int capture_starting_pos = 0;
                    ReadOnlySpan<char> slice = inputSpan.Slice(pos);
                    
                    // Match if at the beginning of the string.
                    if (pos != 0)
                    {
                        UncaptureUntil(0);
                        return false; // The input didn't match.
                    }
                    
                    // Match a whitespace character atomically any number of times.
                    {
                        int iteration = 0;
                        while ((uint)iteration < (uint)slice.Length && char.IsWhiteSpace(slice[iteration]))
                        {
                            iteration++;
                        }
                        
                        slice = slice.Slice(iteration);
                        pos += iteration;
                    }
                    
                    // 1st capture group.
                    {
                        capture_starting_pos = pos;
                        
                        // Match with 7 alternative expressions, atomically.
                        {
                            int alternation_starting_pos = pos;
                            
                            // Branch 0
                            {
                                // Match the string "null".
                                if (!slice.StartsWith("null"))
                                {
                                    goto AlternationBranch;
                                }
                                
                                pos += 4;
                                slice = inputSpan.Slice(pos);
                                goto AlternationMatch;
                                
                                AlternationBranch:
                                pos = alternation_starting_pos;
                                slice = inputSpan.Slice(pos);
                            }
                            
                            // Branch 1
                            {
                                // Match the string "false".
                                if (!slice.StartsWith("false"))
                                {
                                    goto AlternationBranch1;
                                }
                                
                                pos += 5;
                                slice = inputSpan.Slice(pos);
                                goto AlternationMatch;
                                
                                AlternationBranch1:
                                pos = alternation_starting_pos;
                                slice = inputSpan.Slice(pos);
                            }
                            
                            // Branch 2
                            {
                                // Match the string "true".
                                if (!slice.StartsWith("true"))
                                {
                                    goto AlternationBranch2;
                                }
                                
                                pos += 4;
                                slice = inputSpan.Slice(pos);
                                goto AlternationMatch;
                                
                                AlternationBranch2:
                                pos = alternation_starting_pos;
                                slice = inputSpan.Slice(pos);
                            }
                            
                            // Branch 3
                            {
                                // Match '-' atomically, optionally.
                                {
                                    if (!slice.IsEmpty && slice[0] == '-')
                                    {
                                        slice = slice.Slice(1);
                                        pos++;
                                    }
                                }
                                
                                // Match a character in the set [0-9].
                                if (slice.IsEmpty || !char.IsAsciiDigit(slice[0]))
                                {
                                    goto AlternationBranch3;
                                }
                                
                                pos++;
                                slice = inputSpan.Slice(pos);
                                goto AlternationMatch;
                                
                                AlternationBranch3:
                                pos = alternation_starting_pos;
                                slice = inputSpan.Slice(pos);
                            }
                            
                            // Branch 4
                            {
                                // Match a character in the set ["[{].
                                if (slice.IsEmpty || (((ch = slice[0]) != '"') & (ch != '[') & (ch != '{')))
                                {
                                    goto AlternationBranch4;
                                }
                                
                                pos++;
                                slice = inputSpan.Slice(pos);
                                goto AlternationMatch;
                                
                                AlternationBranch4:
                                pos = alternation_starting_pos;
                                slice = inputSpan.Slice(pos);
                            }
                            
                            // Branch 5
                            {
                                // Match the string "//".
                                if (!slice.StartsWith("//"))
                                {
                                    goto AlternationBranch5;
                                }
                                
                                pos += 2;
                                slice = inputSpan.Slice(pos);
                                goto AlternationMatch;
                                
                                AlternationBranch5:
                                pos = alternation_starting_pos;
                                slice = inputSpan.Slice(pos);
                            }
                            
                            // Branch 6
                            {
                                // Match the string "/*".
                                if (!slice.StartsWith("/*"))
                                {
                                    UncaptureUntil(0);
                                    return false; // The input didn't match.
                                }
                                
                                pos += 2;
                                slice = inputSpan.Slice(pos);
                            }
                            
                            AlternationMatch:;
                        }
                        
                        base.Capture(1, capture_starting_pos, pos);
                    }
                    
                    // The input matched.
                    base.runtextpos = pos;
                    base.Capture(0, matchStart, pos);
                    return true;
                    
                    // <summary>Undo captures until it reaches the specified capture position.</summary>
                    [MethodImpl(MethodImplOptions.AggressiveInlining)]
                    void UncaptureUntil(int capturePosition)
                    {
                        while (base.Crawlpos() > capturePosition)
                        {
                            base.Uncapture();
                        }
                    }
                }
            }
        }
 
    }
    
    /// <summary>Custom <see cref="Regex"/>-derived type for the CompilerGeneratedNameRegex method.</summary>
    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
    file sealed class CompilerGeneratedNameRegex_2 : Regex
    {
        /// <summary>Cached, thread-safe singleton instance.</summary>
        internal static readonly CompilerGeneratedNameRegex_2 Instance = new();
    
        /// <summary>Initializes the instance.</summary>
        private CompilerGeneratedNameRegex_2()
        {
            base.pattern = "^<([^>]+)>\\w__(.+)";
            base.roptions = RegexOptions.None;
            ValidateMatchTimeout(Utilities.s_defaultTimeout);
            base.internalMatchTimeout = Utilities.s_defaultTimeout;
            base.factory = new RunnerFactory();
            base.capsize = 3;
        }
            
        /// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary>
        private sealed class RunnerFactory : RegexRunnerFactory
        {
            /// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary>
            protected override RegexRunner CreateInstance() => new Runner();
        
            /// <summary>Provides the runner that contains the custom logic implementing the specified regular expression.</summary>
            private sealed class Runner : RegexRunner
            {
                /// <summary>Scan the <paramref name="inputSpan"/> starting from base.runtextstart for the next match.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                protected override void Scan(ReadOnlySpan<char> inputSpan)
                {
                    // The pattern is anchored.  Validate the current position and try to match at it only.
                    if (TryFindNextPossibleStartingPosition(inputSpan) && !TryMatchAtCurrentPosition(inputSpan))
                    {
                        base.runtextpos = inputSpan.Length;
                    }
                }
        
                /// <summary>Search <paramref name="inputSpan"/> starting from base.runtextpos for the next location a match could possibly start.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                /// <returns>true if a possible match was found; false if no more matches are possible.</returns>
                private bool TryFindNextPossibleStartingPosition(ReadOnlySpan<char> inputSpan)
                {
                    int pos = base.runtextpos;
                    
                    // Any possible match is at least 7 characters.
                    if (pos <= inputSpan.Length - 7)
                    {
                        // The pattern leads with a beginning (\A) anchor.
                        if (pos == 0)
                        {
                            return true;
                        }
                    }
                    
                    // No match found.
                    base.runtextpos = inputSpan.Length;
                    return false;
                }
        
                /// <summary>Determine whether <paramref name="inputSpan"/> at base.runtextpos is a match for the regular expression.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                /// <returns>true if the regular expression matches at the current position; otherwise, false.</returns>
                private bool TryMatchAtCurrentPosition(ReadOnlySpan<char> inputSpan)
                {
                    int pos = base.runtextpos;
                    int matchStart = pos;
                    int capture_starting_pos = 0;
                    int capture_starting_pos1 = 0;
                    ReadOnlySpan<char> slice = inputSpan.Slice(pos);
                    
                    // Match if at the beginning of the string.
                    if (pos != 0)
                    {
                        UncaptureUntil(0);
                        return false; // The input didn't match.
                    }
                    
                    // Match '<'.
                    if (slice.IsEmpty || slice[0] != '<')
                    {
                        UncaptureUntil(0);
                        return false; // The input didn't match.
                    }
                    
                    // 1st capture group.
                    {
                        pos++;
                        slice = inputSpan.Slice(pos);
                        capture_starting_pos = pos;
                        
                        // Match a character other than '>' atomically at least once.
                        {
                            int iteration = slice.IndexOf('>');
                            if (iteration < 0)
                            {
                                iteration = slice.Length;
                            }
                            
                            if (iteration == 0)
                            {
                                UncaptureUntil(0);
                                return false; // The input didn't match.
                            }
                            
                            slice = slice.Slice(iteration);
                            pos += iteration;
                        }
                        
                        base.Capture(1, capture_starting_pos, pos);
                    }
                    
                    if ((uint)slice.Length < 4 ||
                        slice[0] != '>' || // Match '>'.
                        !Utilities.IsWordChar(slice[1]) || // Match a word character.
                        !slice.Slice(2).StartsWith("__", StringComparison.OrdinalIgnoreCase)) // Match the string "__" (ordinal case-insensitive)
                    {
                        UncaptureUntil(0);
                        return false; // The input didn't match.
                    }
                    
                    // 2nd capture group.
                    {
                        pos += 4;
                        slice = inputSpan.Slice(pos);
                        capture_starting_pos1 = pos;
                        
                        // Match a character other than '\n' atomically at least once.
                        {
                            int iteration1 = slice.IndexOf('\n');
                            if (iteration1 < 0)
                            {
                                iteration1 = slice.Length;
                            }
                            
                            if (iteration1 == 0)
                            {
                                UncaptureUntil(0);
                                return false; // The input didn't match.
                            }
                            
                            slice = slice.Slice(iteration1);
                            pos += iteration1;
                        }
                        
                        base.Capture(2, capture_starting_pos1, pos);
                    }
                    
                    // The input matched.
                    base.runtextpos = pos;
                    base.Capture(0, matchStart, pos);
                    return true;
                    
                    // <summary>Undo captures until it reaches the specified capture position.</summary>
                    [MethodImpl(MethodImplOptions.AggressiveInlining)]
                    void UncaptureUntil(int capturePosition)
                    {
                        while (base.Crawlpos() > capturePosition)
                        {
                            base.Uncapture();
                        }
                    }
                }
            }
        }
 
    }
    
    /// <summary>Custom <see cref="Regex"/>-derived type for the InvalidNameCharsRegex method.</summary>
    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
    file sealed class InvalidNameCharsRegex_3 : Regex
    {
        /// <summary>Cached, thread-safe singleton instance.</summary>
        internal static readonly InvalidNameCharsRegex_3 Instance = new();
    
        /// <summary>Initializes the instance.</summary>
        private InvalidNameCharsRegex_3()
        {
            base.pattern = "[^0-9A-Za-z]+";
            base.roptions = RegexOptions.None;
            ValidateMatchTimeout(Utilities.s_defaultTimeout);
            base.internalMatchTimeout = Utilities.s_defaultTimeout;
            base.factory = new RunnerFactory();
            base.capsize = 1;
        }
            
        /// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary>
        private sealed class RunnerFactory : RegexRunnerFactory
        {
            /// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary>
            protected override RegexRunner CreateInstance() => new Runner();
        
            /// <summary>Provides the runner that contains the custom logic implementing the specified regular expression.</summary>
            private sealed class Runner : RegexRunner
            {
                /// <summary>Scan the <paramref name="inputSpan"/> starting from base.runtextstart for the next match.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                protected override void Scan(ReadOnlySpan<char> inputSpan)
                {
                    // Search until we can't find a valid starting position, we find a match, or we reach the end of the input.
                    while (TryFindNextPossibleStartingPosition(inputSpan) &&
                           !TryMatchAtCurrentPosition(inputSpan) &&
                           base.runtextpos != inputSpan.Length)
                    {
                        base.runtextpos++;
                        if (Utilities.s_hasTimeout)
                        {
                            base.CheckTimeout();
                        }
                    }
                }
        
                /// <summary>Search <paramref name="inputSpan"/> starting from base.runtextpos for the next location a match could possibly start.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                /// <returns>true if a possible match was found; false if no more matches are possible.</returns>
                private bool TryFindNextPossibleStartingPosition(ReadOnlySpan<char> inputSpan)
                {
                    int pos = base.runtextpos;
                    
                    // Empty matches aren't possible.
                    if ((uint)pos < (uint)inputSpan.Length)
                    {
                        // The pattern begins with a character in the set [^0-9A-Za-z].
                        // Find the next occurrence. If it can't be found, there's no match.
                        int i = inputSpan.Slice(pos).IndexOfAnyExcept(Utilities.s_asciiLettersAndDigits);
                        if (i >= 0)
                        {
                            base.runtextpos = pos + i;
                            return true;
                        }
                    }
                    
                    // No match found.
                    base.runtextpos = inputSpan.Length;
                    return false;
                }
        
                /// <summary>Determine whether <paramref name="inputSpan"/> at base.runtextpos is a match for the regular expression.</summary>
                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
                /// <returns>true if the regular expression matches at the current position; otherwise, false.</returns>
                private bool TryMatchAtCurrentPosition(ReadOnlySpan<char> inputSpan)
                {
                    int pos = base.runtextpos;
                    int matchStart = pos;
                    ReadOnlySpan<char> slice = inputSpan.Slice(pos);
                    
                    // Match a character in the set [^0-9A-Za-z] atomically at least once.
                    {
                        int iteration = slice.IndexOfAny(Utilities.s_asciiLettersAndDigits);
                        if (iteration < 0)
                        {
                            iteration = slice.Length;
                        }
                        
                        if (iteration == 0)
                        {
                            return false; // The input didn't match.
                        }
                        
                        slice = slice.Slice(iteration);
                        pos += iteration;
                    }
                    
                    // The input matched.
                    base.runtextpos = pos;
                    base.Capture(0, matchStart, pos);
                    return true;
                }
            }
        }
 
    }
    
    /// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary>
    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.14.32403")]
    file static class Utilities
    {
        /// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary>
        internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
        
        /// <summary>Whether <see cref="s_defaultTimeout"/> is non-infinite.</summary>
        internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
        
        /// <summary>Determines whether the character is part of the [\w] set.</summary>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        internal static bool IsWordChar(char ch)
        {
            // Mask of Unicode categories that combine to form [\w]
            const int WordCategoriesMask =
                1 << (int)UnicodeCategory.UppercaseLetter |
                1 << (int)UnicodeCategory.LowercaseLetter |
                1 << (int)UnicodeCategory.TitlecaseLetter |
                1 << (int)UnicodeCategory.ModifierLetter |
                1 << (int)UnicodeCategory.OtherLetter |
                1 << (int)UnicodeCategory.NonSpacingMark |
                1 << (int)UnicodeCategory.DecimalDigitNumber |
                1 << (int)UnicodeCategory.ConnectorPunctuation;
        
            // Bitmap for whether each character 0 through 127 is in [\w]
            ReadOnlySpan<byte> ascii = new byte[]
            {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
                0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x07
            };
        
            // If the char is ASCII, look it up in the bitmap. Otherwise, query its Unicode category.
            int chDiv8 = ch >> 3;
            return (uint)chDiv8 < (uint)ascii.Length ?
                (ascii[chDiv8] & (1 << (ch & 0x7))) != 0 :
                (WordCategoriesMask & (1 << (int)CharUnicodeInfo.GetUnicodeCategory(ch))) != 0;
        }
        
        /// <summary>Supports searching for characters in or not in "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".</summary>
        internal static readonly SearchValues<char> s_asciiLettersAndDigits = SearchValues.Create("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
        
        /// <summary>Supports searching for characters in or not in "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".</summary>
        internal static readonly SearchValues<char> s_asciiWordChars = SearchValues.Create("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz");
    }
}