|
// <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 Aspire.Dashboard.ConsoleLogs
{
partial class UrlParser
{
/// <remarks>
/// Pattern:<br/>
/// <code>((?<!\\+)https?:\\/\\/(?:www\\.)?(?:[-\\p{L}.]+?[.@][a-zA-Z\\d]{2,}|localhost)(?:[-\\w\\p{L}.:%+~#*$!?&/=@]*(?:,(?!\\s))*?)*)</code><br/>
/// Options:<br/>
/// <code>RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Zero-width negative lookbehind.<br/>
/// ○ Match '+' right-to-left.<br/>
/// ○ Match a character in the set [Hh].<br/>
/// ○ Match a character in the set [Tt] exactly 2 times.<br/>
/// ○ Match a character in the set [Pp].<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match the string "://".<br/>
/// ○ Optional (greedy).<br/>
/// ○ Match a character in the set [Ww] exactly 3 times.<br/>
/// ○ Match '.'.<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [-.\p{L}] lazily at least once.<br/>
/// ○ Match a character in the set [.@].<br/>
/// ○ Match a character in the set [A-Za-z\u212A\d] greedily at least twice.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Ll].<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Cc].<br/>
/// ○ Match a character in the set [Aa].<br/>
/// ○ Match a character in the set [Ll].<br/>
/// ○ Match a character in the set [Hh].<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Ss].<br/>
/// ○ Match a character in the set [Tt].<br/>
/// ○ Loop greedily and atomically any number of times.<br/>
/// ○ Match a character in the set [!#-&*+--/:=?@~\w\p{L}] greedily any number of times.<br/>
/// ○ Loop lazily any number of times.<br/>
/// ○ Match ','.<br/>
/// ○ Zero-width negative lookahead.<br/>
/// ○ Match a whitespace character.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
public static partial global::System.Text.RegularExpressions.Regex GenerateUrlRegEx() => global::System.Text.RegularExpressions.Generated.GenerateUrlRegEx_0.Instance;
}
}
namespace Aspire.Dashboard.Model
{
partial class ConnectionStringParser
{
/// <remarks>
/// Pattern:<br/>
/// <code>(\\[[^\\]]+\\]|[^,:;\\s]+)[:,](\\d{1,5})</code><br/>
/// Options:<br/>
/// <code>RegexOptions.Compiled</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ 1st capture group.<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match '['.<br/>
/// ○ Match a character other than ']' atomically at least once.<br/>
/// ○ Match ']'.<br/>
/// ○ Match a character in the set [^,:;\s] greedily at least once.<br/>
/// ○ Match a character in the set [,:].<br/>
/// ○ 2nd capture group.<br/>
/// ○ Match a Unicode digit atomically at least 1 and at most 5 times.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex HostPortRegex() => global::System.Text.RegularExpressions.Generated.HostPortRegex_1.Instance;
}
}
namespace Aspire.Dashboard.Model
{
partial class ConnectionStringParser
{
/// <remarks>
/// Pattern:<br/>
/// <code>^jdbc:[^:]+://([^:/\\s]+)(?::(\\d+))?(?:/.*)?</code><br/>
/// Options:<br/>
/// <code>RegexOptions.IgnoreCase | RegexOptions.Compiled</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Match if at the beginning of the string.<br/>
/// ○ Match a character in the set [Jj].<br/>
/// ○ Match a character in the set [Dd].<br/>
/// ○ Match a character in the set [Bb].<br/>
/// ○ Match a character in the set [Cc].<br/>
/// ○ Match ':'.<br/>
/// ○ Match a character other than ':' atomically at least once.<br/>
/// ○ Match the string "://".<br/>
/// ○ 1st capture group.<br/>
/// ○ Match a character in the set [^/:\s] greedily at least once.<br/>
/// ○ Optional (greedy).<br/>
/// ○ Match ':'.<br/>
/// ○ 2nd capture group.<br/>
/// ○ Match a Unicode digit greedily at least once.<br/>
/// ○ Optional (greedy).<br/>
/// ○ Match '/'.<br/>
/// ○ Match a character other than '\n' atomically any number of times.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex JdbcUrlRegex() => global::System.Text.RegularExpressions.Generated.JdbcUrlRegex_2.Instance;
}
}
namespace Aspire.Dashboard.Model
{
partial class ResourceOutgoingPeerResolver
{
/// <remarks>
/// Pattern:<br/>
/// <code>^(?:127\\.0\\.0\\.1|host\\.docker\\.internal|host\\.containers\\.internal):</code><br/>
/// Options:<br/>
/// <code>RegexOptions.IgnoreCase | RegexOptions.CultureInvariant</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Match if at the beginning of the string.<br/>
/// ○ Match with 3 alternative expressions.<br/>
/// ○ Match the string "127.0.0.1".<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Hh].<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Ss].<br/>
/// ○ Match a character in the set [Tt].<br/>
/// ○ Match '.'.<br/>
/// ○ Match a character in the set [Dd].<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Cc].<br/>
/// ○ Match a character in the set [Kk\u212A].<br/>
/// ○ Match a character in the set [Ee].<br/>
/// ○ Match a character in the set [Rr].<br/>
/// ○ Match '.'.<br/>
/// ○ Match a character in the set [Ii].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match a character in the set [Tt].<br/>
/// ○ Match a character in the set [Ee].<br/>
/// ○ Match a character in the set [Rr].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match a character in the set [Aa].<br/>
/// ○ Match a character in the set [Ll].<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Hh].<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Ss].<br/>
/// ○ Match a character in the set [Tt].<br/>
/// ○ Match '.'.<br/>
/// ○ Match a character in the set [Cc].<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match a character in the set [Tt].<br/>
/// ○ Match a character in the set [Aa].<br/>
/// ○ Match a character in the set [Ii].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match a character in the set [Ee].<br/>
/// ○ Match a character in the set [Rr].<br/>
/// ○ Match a character in the set [Ss].<br/>
/// ○ Match '.'.<br/>
/// ○ Match a character in the set [Ii].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match a character in the set [Tt].<br/>
/// ○ Match a character in the set [Ee].<br/>
/// ○ Match a character in the set [Rr].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match a character in the set [Aa].<br/>
/// ○ Match a character in the set [Ll].<br/>
/// ○ Match ':'.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex HostRegex() => global::System.Text.RegularExpressions.Generated.HostRegex_3.Instance;
}
}
namespace Aspire.Dashboard.Utils
{
partial class FormatHelpers
{
/// <remarks>
/// Pattern:<br/>
/// <code>(:ss|\\.ss|:s|\\.s)</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ 1st capture group.<br/>
/// ○ Match with 2 alternative expressions, atomically.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match the string ":s".<br/>
/// ○ Match with 2 alternative expressions, atomically.<br/>
/// ○ Match 's'.<br/>
/// ○ Match an empty string.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match the string ".s".<br/>
/// ○ Match with 2 alternative expressions, atomically.<br/>
/// ○ Match 's'.<br/>
/// ○ Match an empty string.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex MatchSecondsInTimeFormatPattern() => global::System.Text.RegularExpressions.Generated.MatchSecondsInTimeFormatPattern_4.Instance;
}
}
namespace Aspire.Dashboard.ConsoleLogs
{
partial class TimestampParser
{
/// <remarks>
/// Pattern:<br/>
/// <code>^ # Starts the string\r\n(\\d{4}) # Four digits for the year\r\n- # Separator for the date\r\n(0[1-9]|1[0-2]) # Two digits for the month, restricted to 01-12\r\n- # Separator for the date\r\n(0[1-9]|[12][0-9]|3[01]) # Two digits for the day, restricted to 01-31\r\nT # Literal, separator between date and time, either a T or a space\r\n([01][0-9]|2[0-3]) # Two digits for the hour, restricted to 00-23\r\n: # Separator for the time\r\n([0-5][0-9]) # Two digits for the minutes, restricted to 00-59\r\n: # Separator for the time\r\n([0-5][0-9]) # Two digits for the seconds, restricted to 00-59\r\n(\\.\\d{1,9})? # A period and up to nine digits for the partial seconds (optional)\r\n(Z|([Z+-]([01][0-9]|2[0-3]):([0-5][0-9])))? # Time Zone offset, in the form Z or ZHH:MM or +HH:MM or -HH:MM (optional)</code><br/>
/// Options:<br/>
/// <code>RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace | RegexOptions.CultureInvariant</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Match if at the beginning of the string.<br/>
/// ○ Match a Unicode digit exactly 4 times.<br/>
/// ○ Match '-'.<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match '0'.<br/>
/// ○ Match a character in the set [1-9].<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match '1'.<br/>
/// ○ Match a character in the set [0-2].<br/>
/// ○ Match '-'.<br/>
/// ○ Match with 3 alternative expressions.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match '0'.<br/>
/// ○ Match a character in the set [1-9].<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [12].<br/>
/// ○ Match a character in the set [0-9].<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match '3'.<br/>
/// ○ Match a character in the set [01].<br/>
/// ○ Match 'T'.<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [01].<br/>
/// ○ Match a character in the set [0-9].<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match '2'.<br/>
/// ○ Match a character in the set [0-3].<br/>
/// ○ Match ':'.<br/>
/// ○ Match a character in the set [0-5].<br/>
/// ○ Match a character in the set [0-9].<br/>
/// ○ Match ':'.<br/>
/// ○ Match a character in the set [0-5].<br/>
/// ○ Match a character in the set [0-9].<br/>
/// ○ Optional (greedy).<br/>
/// ○ Match '.'.<br/>
/// ○ Match a Unicode digit greedily at least 1 and at most 9 times.<br/>
/// ○ Optional (greedy).<br/>
/// ○ Match with 2 alternative expressions, atomically.<br/>
/// ○ Match 'Z'.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [+-Z].<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [01].<br/>
/// ○ Match a character in the set [0-9].<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match '2'.<br/>
/// ○ Match a character in the set [0-3].<br/>
/// ○ Match ':'.<br/>
/// ○ Match a character in the set [0-5].<br/>
/// ○ Match a character in the set [0-9].<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex GenerateRfc3339RegEx() => global::System.Text.RegularExpressions.Generated.GenerateRfc3339RegEx_5.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 GenerateUrlRegEx method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
file sealed class GenerateUrlRegEx_0 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly GenerateUrlRegEx_0 Instance = new();
/// <summary>Initializes the instance.</summary>
private GenerateUrlRegEx_0()
{
base.pattern = "((?<!\\+)https?:\\/\\/(?:www\\.)?(?:[-\\p{L}.]+?[.@][a-zA-Z\\d]{2,}|localhost)(?:[-\\w\\p{L}.:%+~#*$!?&/=@]*(?:,(?!\\s))*?)*)";
base.roptions = RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant;
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;
// Any possible match is at least 11 characters.
if (pos <= inputSpan.Length - 11)
{
// The pattern has the literal "http" ordinal case-insensitive at the beginning of the pattern. Find the next occurrence.
// If it can't be found, there's no match.
int i = inputSpan.Slice(pos).IndexOf("http", StringComparison.OrdinalIgnoreCase);
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;
char ch;
int alternation_branch = 0;
int alternation_starting_pos = 0;
int charloop_starting_pos = 0, charloop_ending_pos = 0;
int charloop_starting_pos1 = 0, charloop_ending_pos1 = 0;
int lazyloop_iteration = 0;
int lazyloop_pos = 0;
int loop_iteration = 0;
int loop_iteration1 = 0, loop_starting_pos = 0;
int stackpos = 0;
int startingStackpos = 0;
ReadOnlySpan<char> slice = inputSpan.Slice(pos);
// Zero-width negative lookbehind.
{
slice = inputSpan.Slice(pos);
int negativelookbehind_starting_pos = pos;
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
// Match '+' right-to-left.
if ((uint)(pos - 1) >= inputSpan.Length || inputSpan[pos - 1] != '+')
{
goto NegativeLookaroundMatch;
}
pos--;
return false; // The input didn't match.
NegativeLookaroundMatch:
pos = negativelookbehind_starting_pos;
slice = inputSpan.Slice(pos);
}
if ((uint)slice.Length < 4 ||
!slice.StartsWith("http", StringComparison.OrdinalIgnoreCase)) // Match the string "http" (ordinal case-insensitive)
{
return false; // The input didn't match.
}
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)4 && ((slice[4] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
// Match the string "://".
if (!slice.Slice(4).StartsWith("://"))
{
return false; // The input didn't match.
}
// Optional (greedy).
//{
pos += 7;
slice = inputSpan.Slice(pos);
loop_iteration = 0;
LoopBody:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos);
loop_iteration++;
if ((uint)slice.Length < 4 ||
!slice.StartsWith("www.", StringComparison.OrdinalIgnoreCase)) // Match the string "www." (ordinal case-insensitive)
{
goto LoopIterationNoMatch;
}
pos += 4;
slice = inputSpan.Slice(pos);
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration == 0)
{
goto LoopBody;
}
goto LoopEnd;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch:
if (--loop_iteration < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
return false; // The input didn't match.
}
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
LoopEnd:;
//}
// Match with 2 alternative expressions.
//{
alternation_starting_pos = pos;
// Branch 0
//{
// Match a character in the set [-.\p{L}] lazily at least once.
//{
if (slice.IsEmpty || ((ch = slice[0]) < 128 ? ("\0\0怀\0\ufffe߿\ufffe߿"[ch >> 4] & (1 << (ch & 0xF))) == 0 : !RegexRunner.CharInClass((char)ch, "\0\u0002\a-/\0\u0002\u0004\u0005\u0003\u0001\0")))
{
goto AlternationBranch;
}
pos++;
slice = inputSpan.Slice(pos);
lazyloop_pos = pos;
goto LazyLoopEnd;
LazyLoopBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
pos = lazyloop_pos;
slice = inputSpan.Slice(pos);
if (slice.IsEmpty || ((ch = slice[0]) < 128 ? ("\0\0怀\0\ufffe߿\ufffe߿"[ch >> 4] & (1 << (ch & 0xF))) == 0 : !RegexRunner.CharInClass((char)ch, "\0\u0002\a-/\0\u0002\u0004\u0005\u0003\u0001\0")))
{
goto AlternationBranch;
}
pos++;
slice = inputSpan.Slice(pos);
lazyloop_pos = pos;
LazyLoopEnd:;
//}
// Match a character in the set [.@].
if (slice.IsEmpty || (((ch = slice[0]) != '.') & (ch != '@')))
{
goto LazyLoopBacktrack;
}
// Match a character in the set [A-Za-z\u212A\d] greedily at least twice.
//{
pos++;
slice = inputSpan.Slice(pos);
charloop_starting_pos = pos;
int iteration = 0;
while ((uint)iteration < (uint)slice.Length && ((ch = slice[iteration]) < 128 ? char.IsAsciiLetterOrDigit(ch) : RegexRunner.CharInClass((char)ch, "\0\u0006\u0001A[a{KÅ\t")))
{
iteration++;
}
if (iteration < 2)
{
goto LazyLoopBacktrack;
}
slice = slice.Slice(iteration);
pos += iteration;
charloop_ending_pos = pos;
charloop_starting_pos += 2;
goto CharLoopEnd;
CharLoopBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos >= charloop_ending_pos)
{
goto LazyLoopBacktrack;
}
pos = --charloop_ending_pos;
slice = inputSpan.Slice(pos);
CharLoopEnd:
//}
alternation_branch = 0;
goto AlternationMatch;
AlternationBranch:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
//}
// Branch 1
//{
if ((uint)slice.Length < 9 ||
!slice.StartsWith("localhost", StringComparison.OrdinalIgnoreCase)) // Match the string "localhost" (ordinal case-insensitive)
{
goto LoopIterationNoMatch;
}
alternation_branch = 1;
pos += 9;
slice = inputSpan.Slice(pos);
goto AlternationMatch;
//}
AlternationBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
switch (alternation_branch)
{
case 0:
goto CharLoopBacktrack;
case 1:
goto LoopIterationNoMatch;
}
AlternationMatch:;
//}
// Atomic group.
{
int atomic_stackpos = stackpos;
// Loop greedily and atomically any number of times.
//{
startingStackpos = stackpos;
loop_starting_pos = pos;
loop_iteration1 = 0;
LoopBody1:
Utilities.StackPush(ref base.runstack!, ref stackpos, loop_starting_pos, pos);
loop_starting_pos = pos;
loop_iteration1++;
// Match a character in the set [!#-&*+--/:=?@~\w\p{L}] greedily any number of times.
//{
charloop_starting_pos1 = pos;
int iteration1 = 0;
while ((uint)iteration1 < (uint)slice.Length && ((ch = slice[iteration1]) < 128 ? ("\0\0ꟿ\uffff蟿\ufffe䟿"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\0\u0010\u0011!\"#'*,-0:;=>?A~\u007f\0\u0002\u0004\u0005\u0003\u0001\u0006\t\u0013\0\0\u0002\u0004\u0005\u0003\u0001\0")))
{
iteration1++;
}
slice = slice.Slice(iteration1);
pos += iteration1;
charloop_ending_pos1 = pos;
goto CharLoopEnd1;
CharLoopBacktrack1:
Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos1, out charloop_starting_pos1);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos1 >= charloop_ending_pos1)
{
goto LoopIterationNoMatch1;
}
pos = --charloop_ending_pos1;
slice = inputSpan.Slice(pos);
CharLoopEnd1:
Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos1, charloop_ending_pos1);
//}
// Loop lazily any number of times.
//{
lazyloop_iteration = 0;
goto LazyLoopEnd1;
LazyLoopBody:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos);
lazyloop_iteration++;
// Match ','.
if (slice.IsEmpty || slice[0] != ',')
{
goto LazyLoopIterationNoMatch;
}
// Zero-width negative lookahead.
{
pos++;
slice = inputSpan.Slice(pos);
int negativelookahead_starting_pos = pos;
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
// Match a whitespace character.
if (slice.IsEmpty || !char.IsWhiteSpace(slice[0]))
{
goto NegativeLookaroundMatch1;
}
goto LazyLoopIterationNoMatch;
NegativeLookaroundMatch1:
pos = negativelookahead_starting_pos;
slice = inputSpan.Slice(pos);
}
goto LazyLoopEnd1;
// The lazy loop iteration failed to match.
LazyLoopIterationNoMatch:
lazyloop_iteration--;
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
stackpos -= lazyloop_iteration;
goto CharLoopBacktrack1;
LazyLoopEnd1:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, lazyloop_iteration);
goto LazyLoopSkipBacktrack;
LazyLoopBacktrack1:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
Utilities.StackPop(base.runstack!, ref stackpos, out lazyloop_iteration, out pos);
slice = inputSpan.Slice(pos);
goto LazyLoopBody;
LazyLoopSkipBacktrack:;
//}
// The loop is unbounded. Continue iterating greedily as long as the last iteration wasn't empty.
if (pos != loop_starting_pos)
{
goto LoopBody1;
}
goto LoopEnd1;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch1:
if (--loop_iteration1 < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
goto AlternationBacktrack;
}
Utilities.StackPop(base.runstack!, ref stackpos, out pos, out loop_starting_pos);
slice = inputSpan.Slice(pos);
LoopEnd1:
stackpos = startingStackpos; // Ensure any remaining backtracking state is removed.
//}
stackpos = atomic_stackpos;
}
// The input matched.
base.runtextpos = pos;
base.Capture(0, matchStart, pos);
return true;
}
}
}
}
/// <summary>Custom <see cref="Regex"/>-derived type for the HostPortRegex method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
file sealed class HostPortRegex_1 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly HostPortRegex_1 Instance = new();
/// <summary>Initializes the instance.</summary>
private HostPortRegex_1()
{
base.pattern = "(\\[[^\\]]+\\]|[^,:;\\s]+)[:,](\\d{1,5})";
base.roptions = RegexOptions.Compiled;
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)
{
// 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;
// Any possible match is at least 3 characters.
if (pos <= inputSpan.Length - 3)
{
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 alternation_branch = 0;
int alternation_starting_capturepos = 0;
int alternation_starting_pos = 0;
int capture_starting_pos = 0;
int capture_starting_pos1 = 0;
int charloop_capture_pos = 0;
int charloop_starting_pos = 0, charloop_ending_pos = 0;
ReadOnlySpan<char> slice = inputSpan.Slice(pos);
// 1st capture group.
//{
capture_starting_pos = pos;
// Match with 2 alternative expressions.
//{
alternation_starting_pos = pos;
alternation_starting_capturepos = base.Crawlpos();
// Branch 0
//{
// Match '['.
if (slice.IsEmpty || slice[0] != '[')
{
goto AlternationBranch;
}
// Match a character other than ']' atomically at least once.
{
int iteration = slice.Slice(1).IndexOf(']');
if (iteration < 0)
{
iteration = slice.Length - 1;
}
if (iteration == 0)
{
goto AlternationBranch;
}
slice = slice.Slice(iteration);
pos += iteration;
}
// Match ']'.
if ((uint)slice.Length < 2 || slice[1] != ']')
{
goto AlternationBranch;
}
alternation_branch = 0;
pos += 2;
slice = inputSpan.Slice(pos);
goto AlternationMatch;
AlternationBranch:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos);
//}
// Branch 1
//{
// Match a character in the set [^,:;\s] greedily at least once.
//{
charloop_starting_pos = pos;
int iteration1 = 0;
while ((uint)iteration1 < (uint)slice.Length && ((ch = slice[iteration1]) < 128 ? ("쇿\uffff\uffff\uffff\uffff\uffff"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\u0001\u0004\u0001,-:<d")))
{
iteration1++;
}
if (iteration1 == 0)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
slice = slice.Slice(iteration1);
pos += iteration1;
charloop_ending_pos = pos;
charloop_starting_pos++;
goto CharLoopEnd;
CharLoopBacktrack:
UncaptureUntil(charloop_capture_pos);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos >= charloop_ending_pos)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
pos = --charloop_ending_pos;
slice = inputSpan.Slice(pos);
CharLoopEnd:
charloop_capture_pos = base.Crawlpos();
//}
alternation_branch = 1;
goto AlternationMatch;
//}
AlternationBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
switch (alternation_branch)
{
case 0:
goto AlternationBranch;
case 1:
goto CharLoopBacktrack;
}
AlternationMatch:;
//}
base.Capture(1, capture_starting_pos, pos);
goto CaptureSkipBacktrack;
CaptureBacktrack:
goto AlternationBacktrack;
CaptureSkipBacktrack:;
//}
// Match a character in the set [,:].
if (slice.IsEmpty || (((ch = slice[0]) != ',') & (ch != ':')))
{
goto CaptureBacktrack;
}
// 2nd capture group.
{
pos++;
slice = inputSpan.Slice(pos);
capture_starting_pos1 = pos;
// Match a Unicode digit atomically at least 1 and at most 5 times.
{
int iteration2 = 0;
while (iteration2 < 5 && (uint)iteration2 < (uint)slice.Length && char.IsDigit(slice[iteration2]))
{
iteration2++;
}
if (iteration2 == 0)
{
goto CaptureBacktrack;
}
slice = slice.Slice(iteration2);
pos += iteration2;
}
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 JdbcUrlRegex method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
file sealed class JdbcUrlRegex_2 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly JdbcUrlRegex_2 Instance = new();
/// <summary>Initializes the instance.</summary>
private JdbcUrlRegex_2()
{
base.pattern = "^jdbc:[^:]+://([^:/\\s]+)(?::(\\d+))?(?:/.*)?";
base.roptions = RegexOptions.IgnoreCase | RegexOptions.Compiled;
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 10 characters.
if (pos <= inputSpan.Length - 10)
{
// 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;
int charloop_capture_pos = 0;
int charloop_starting_pos = 0, charloop_ending_pos = 0;
int charloop_starting_pos1 = 0, charloop_ending_pos1 = 0;
int loop_iteration = 0;
int loop_iteration1 = 0;
int stackpos = 0;
int startingStackpos = 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.
}
if ((uint)slice.Length < 5 ||
!slice.StartsWith("jdbc:", StringComparison.OrdinalIgnoreCase)) // Match the string "jdbc:" (ordinal case-insensitive)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
// Match a character other than ':' atomically at least once.
{
int iteration = slice.Slice(5).IndexOf(':');
if (iteration < 0)
{
iteration = slice.Length - 5;
}
if (iteration == 0)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
slice = slice.Slice(iteration);
pos += iteration;
}
// Match the string "://".
if (!slice.Slice(5).StartsWith("://"))
{
UncaptureUntil(0);
return false; // The input didn't match.
}
// 1st capture group.
//{
pos += 8;
slice = inputSpan.Slice(pos);
capture_starting_pos = pos;
// Match a character in the set [^/:\s] greedily at least once.
//{
charloop_starting_pos = pos;
int iteration1 = 0;
while ((uint)iteration1 < (uint)slice.Length && ((ch = slice[iteration1]) < 128 ? ("쇿\uffff翾ﯿ\uffff\uffff\uffff\uffff"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\u0001\u0004\u0001/0:;d")))
{
iteration1++;
}
if (iteration1 == 0)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
slice = slice.Slice(iteration1);
pos += iteration1;
charloop_ending_pos = pos;
charloop_starting_pos++;
goto CharLoopEnd;
CharLoopBacktrack:
UncaptureUntil(charloop_capture_pos);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos >= charloop_ending_pos)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
pos = --charloop_ending_pos;
slice = inputSpan.Slice(pos);
CharLoopEnd:
charloop_capture_pos = base.Crawlpos();
//}
base.Capture(1, capture_starting_pos, pos);
goto CaptureSkipBacktrack;
CaptureBacktrack:
goto CharLoopBacktrack;
CaptureSkipBacktrack:;
//}
// Optional (greedy).
//{
loop_iteration = 0;
LoopBody:
Utilities.StackPush(ref base.runstack!, ref stackpos, base.Crawlpos(), pos);
loop_iteration++;
// Match ':'.
if (slice.IsEmpty || slice[0] != ':')
{
goto LoopIterationNoMatch;
}
// 2nd capture group.
//{
pos++;
slice = inputSpan.Slice(pos);
int capture_starting_pos1 = pos;
// Match a Unicode digit greedily at least once.
//{
charloop_starting_pos1 = pos;
int iteration2 = 0;
while ((uint)iteration2 < (uint)slice.Length && char.IsDigit(slice[iteration2]))
{
iteration2++;
}
if (iteration2 == 0)
{
goto LoopIterationNoMatch;
}
slice = slice.Slice(iteration2);
pos += iteration2;
charloop_ending_pos1 = pos;
charloop_starting_pos1++;
goto CharLoopEnd1;
CharLoopBacktrack1:
UncaptureUntil(base.runstack![--stackpos]);
Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos1, out charloop_starting_pos1);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos1 >= charloop_ending_pos1)
{
goto LoopIterationNoMatch;
}
pos = --charloop_ending_pos1;
slice = inputSpan.Slice(pos);
CharLoopEnd1:
Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos1, charloop_ending_pos1, base.Crawlpos());
//}
base.Capture(2, capture_starting_pos1, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos1);
goto CaptureSkipBacktrack1;
CaptureBacktrack1:
capture_starting_pos1 = base.runstack![--stackpos];
goto CharLoopBacktrack1;
CaptureSkipBacktrack1:;
//}
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration == 0)
{
goto LoopBody;
}
goto LoopEnd;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch:
if (--loop_iteration < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
goto CaptureBacktrack;
}
pos = base.runstack![--stackpos];
UncaptureUntil(base.runstack![--stackpos]);
slice = inputSpan.Slice(pos);
goto LoopEnd;
LoopBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (loop_iteration == 0)
{
// No iterations of the loop remain to backtrack into. Fail the loop.
goto CaptureBacktrack;
}
goto CaptureBacktrack1;
LoopEnd:;
//}
// Optional (greedy).
{
startingStackpos = stackpos;
loop_iteration1 = 0;
LoopBody1:
Utilities.StackPush(ref base.runstack!, ref stackpos, base.Crawlpos(), pos);
loop_iteration1++;
// Match '/'.
if (slice.IsEmpty || slice[0] != '/')
{
goto LoopIterationNoMatch1;
}
// Match a character other than '\n' atomically any number of times.
{
int iteration3 = slice.Slice(1).IndexOf('\n');
if (iteration3 < 0)
{
iteration3 = slice.Length - 1;
}
slice = slice.Slice(iteration3);
pos += iteration3;
}
pos++;
slice = inputSpan.Slice(pos);
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration1 == 0)
{
goto LoopBody1;
}
goto LoopEnd1;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch1:
if (--loop_iteration1 < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
goto LoopBacktrack;
}
pos = base.runstack![--stackpos];
UncaptureUntil(base.runstack![--stackpos]);
slice = inputSpan.Slice(pos);
LoopEnd1:
stackpos = startingStackpos; // Ensure any remaining backtracking state is removed.
}
// 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 HostRegex method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
file sealed class HostRegex_3 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly HostRegex_3 Instance = new();
/// <summary>Initializes the instance.</summary>
private HostRegex_3()
{
base.pattern = "^(?:127\\.0\\.0\\.1|host\\.docker\\.internal|host\\.containers\\.internal):";
base.roptions = RegexOptions.IgnoreCase | RegexOptions.CultureInvariant;
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)
{
// 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 10 characters.
if (pos <= inputSpan.Length - 10)
{
// 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 alternation_branch = 0;
int alternation_starting_pos = 0;
ReadOnlySpan<char> slice = inputSpan.Slice(pos);
// Match if at the beginning of the string.
if (pos != 0)
{
return false; // The input didn't match.
}
// Match with 3 alternative expressions.
//{
alternation_starting_pos = pos;
// Branch 0
//{
// Match the string "127.0.0.1".
if (!slice.StartsWith("127.0.0.1"))
{
goto AlternationBranch;
}
alternation_branch = 0;
pos += 9;
slice = inputSpan.Slice(pos);
goto AlternationMatch;
AlternationBranch:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
//}
// Branch 1
//{
if ((uint)slice.Length < 20 ||
!slice.StartsWith("host.doc", StringComparison.OrdinalIgnoreCase) || // Match the string "host.doc" (ordinal case-insensitive)
((((ch = slice[8]) | 0x20) != 'k') & (ch != 'K')) || // Match a character in the set [Kk\u212A].
!slice.Slice(9).StartsWith("er.internal", StringComparison.OrdinalIgnoreCase)) // Match the string "er.internal" (ordinal case-insensitive)
{
goto AlternationBranch1;
}
alternation_branch = 1;
pos += 20;
slice = inputSpan.Slice(pos);
goto AlternationMatch;
AlternationBranch1:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
//}
// Branch 2
//{
if ((uint)slice.Length < 24 ||
!slice.StartsWith("host.containers.internal", StringComparison.OrdinalIgnoreCase)) // Match the string "host.containers.internal" (ordinal case-insensitive)
{
return false; // The input didn't match.
}
alternation_branch = 2;
pos += 24;
slice = inputSpan.Slice(pos);
goto AlternationMatch;
//}
AlternationBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
switch (alternation_branch)
{
case 0:
goto AlternationBranch;
case 1:
goto AlternationBranch1;
case 2:
return false; // The input didn't match.
}
AlternationMatch:;
//}
// Match ':'.
if (slice.IsEmpty || slice[0] != ':')
{
goto AlternationBacktrack;
}
// The input matched.
pos++;
base.runtextpos = pos;
base.Capture(0, matchStart, pos);
return true;
}
}
}
}
/// <summary>Custom <see cref="Regex"/>-derived type for the MatchSecondsInTimeFormatPattern method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
file sealed class MatchSecondsInTimeFormatPattern_4 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly MatchSecondsInTimeFormatPattern_4 Instance = new();
/// <summary>Initializes the instance.</summary>
private MatchSecondsInTimeFormatPattern_4()
{
base.pattern = "(:ss|\\.ss|:s|\\.s)";
base.roptions = RegexOptions.None;
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)
{
// 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;
// Any possible match is at least 2 characters.
if (pos <= inputSpan.Length - 2)
{
// The pattern begins with a character in the set [.:].
// Find the next occurrence. If it can't be found, there's no match.
ReadOnlySpan<char> span = inputSpan.Slice(pos);
for (int i = 0; i < span.Length - 1; i++)
{
int indexOfPos = span.Slice(i).IndexOfAny('.', ':');
if (indexOfPos < 0)
{
goto NoMatchFound;
}
i += indexOfPos;
// The primary set being searched for was found. 1 more set will be checked so as
// to minimize the number of places TryMatchAtCurrentPosition is run unnecessarily.
// Make sure it fits in the remainder of the input.
if ((uint)(i + 1) >= (uint)span.Length)
{
goto NoMatchFound;
}
if ((span[i + 1] == 's'))
{
base.runtextpos = pos + i;
return true;
}
}
}
// No match found.
NoMatchFound:
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;
ReadOnlySpan<char> slice = inputSpan.Slice(pos);
// 1st capture group.
{
capture_starting_pos = pos;
// Match with 2 alternative expressions, atomically.
{
if (slice.IsEmpty)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
switch (slice[0])
{
case ':':
// Match 's'.
if ((uint)slice.Length < 2 || slice[1] != 's')
{
UncaptureUntil(0);
return false; // The input didn't match.
}
// Match with 2 alternative expressions, atomically.
{
int alternation_starting_pos = pos;
// Branch 0
{
// Match 's'.
if ((uint)slice.Length < 3 || slice[2] != 's')
{
goto AlternationBranch;
}
pos += 3;
slice = inputSpan.Slice(pos);
goto AlternationMatch;
AlternationBranch:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
}
// Branch 1
{
pos += 2;
slice = inputSpan.Slice(pos);
}
AlternationMatch:;
}
break;
case '.':
// Match 's'.
if ((uint)slice.Length < 2 || slice[1] != 's')
{
UncaptureUntil(0);
return false; // The input didn't match.
}
// Match with 2 alternative expressions, atomically.
{
int alternation_starting_pos1 = pos;
// Branch 0
{
// Match 's'.
if ((uint)slice.Length < 3 || slice[2] != 's')
{
goto AlternationBranch1;
}
pos += 3;
slice = inputSpan.Slice(pos);
goto AlternationMatch1;
AlternationBranch1:
pos = alternation_starting_pos1;
slice = inputSpan.Slice(pos);
}
// Branch 1
{
pos += 2;
slice = inputSpan.Slice(pos);
}
AlternationMatch1:;
}
break;
default:
UncaptureUntil(0);
return false; // The input didn't match.
}
}
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 GenerateRfc3339RegEx method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
file sealed class GenerateRfc3339RegEx_5 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly GenerateRfc3339RegEx_5 Instance = new();
/// <summary>Initializes the instance.</summary>
private GenerateRfc3339RegEx_5()
{
base.pattern = "^ # Starts the string\r\n(\\d{4}) # Four digits for the year\r\n- # Separator for the date\r\n(0[1-9]|1[0-2]) # Two digits for the month, restricted to 01-12\r\n- # Separator for the date\r\n(0[1-9]|[12][0-9]|3[01]) # Two digits for the day, restricted to 01-31\r\nT # Literal, separator between date and time, either a T or a space\r\n([01][0-9]|2[0-3]) # Two digits for the hour, restricted to 00-23\r\n: # Separator for the time\r\n([0-5][0-9]) # Two digits for the minutes, restricted to 00-59\r\n: # Separator for the time\r\n([0-5][0-9]) # Two digits for the seconds, restricted to 00-59\r\n(\\.\\d{1,9})? # A period and up to nine digits for the partial seconds (optional)\r\n(Z|([Z+-]([01][0-9]|2[0-3]):([0-5][0-9])))? # Time Zone offset, in the form Z or ZHH:MM or +HH:MM or -HH:MM (optional)";
base.roptions = RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace | RegexOptions.CultureInvariant;
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)
{
// 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 19 characters.
if (pos <= inputSpan.Length - 19)
{
// 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 charloop_starting_pos = 0, charloop_ending_pos = 0;
int loop_iteration = 0;
int loop_iteration1 = 0;
int stackpos = 0;
int startingStackpos = 0;
ReadOnlySpan<char> slice = inputSpan.Slice(pos);
// Match if at the beginning of the string.
if (pos != 0)
{
return false; // The input didn't match.
}
if ((uint)slice.Length < 5 ||
!char.IsDigit(slice[0]) || // Match a Unicode digit exactly 4 times.
!char.IsDigit(slice[1]) ||
!char.IsDigit(slice[2]) ||
!char.IsDigit(slice[3]) ||
slice[4] != '-') // Match '-'.
{
return false; // The input didn't match.
}
// Match with 2 alternative expressions.
//{
if ((uint)slice.Length < 6)
{
return false; // The input didn't match.
}
switch (slice[5])
{
case '0':
// Match a character in the set [1-9].
if ((uint)slice.Length < 7 || !char.IsBetween(slice[6], '1', '9'))
{
return false; // The input didn't match.
}
pos += 7;
slice = inputSpan.Slice(pos);
break;
case '1':
// Match a character in the set [0-2].
if ((uint)slice.Length < 7 || !char.IsBetween(slice[6], '0', '2'))
{
return false; // The input didn't match.
}
pos += 7;
slice = inputSpan.Slice(pos);
break;
default:
return false; // The input didn't match.
}
//}
// Match '-'.
if (slice.IsEmpty || slice[0] != '-')
{
return false; // The input didn't match.
}
// Match with 3 alternative expressions.
//{
if ((uint)slice.Length < 2)
{
return false; // The input didn't match.
}
switch (slice[1])
{
case '0':
// Match a character in the set [1-9].
if ((uint)slice.Length < 3 || !char.IsBetween(slice[2], '1', '9'))
{
return false; // The input didn't match.
}
pos += 3;
slice = inputSpan.Slice(pos);
break;
case '1' or '2':
// Match a character in the set [0-9].
if ((uint)slice.Length < 3 || !char.IsAsciiDigit(slice[2]))
{
return false; // The input didn't match.
}
pos += 3;
slice = inputSpan.Slice(pos);
break;
case '3':
// Match a character in the set [01].
if ((uint)slice.Length < 3 || !char.IsBetween(slice[2], '0', '1'))
{
return false; // The input didn't match.
}
pos += 3;
slice = inputSpan.Slice(pos);
break;
default:
return false; // The input didn't match.
}
//}
// Match 'T'.
if (slice.IsEmpty || slice[0] != 'T')
{
return false; // The input didn't match.
}
// Match with 2 alternative expressions.
//{
if ((uint)slice.Length < 2)
{
return false; // The input didn't match.
}
switch (slice[1])
{
case '0' or '1':
// Match a character in the set [0-9].
if ((uint)slice.Length < 3 || !char.IsAsciiDigit(slice[2]))
{
return false; // The input didn't match.
}
pos += 3;
slice = inputSpan.Slice(pos);
break;
case '2':
// Match a character in the set [0-3].
if ((uint)slice.Length < 3 || !char.IsBetween(slice[2], '0', '3'))
{
return false; // The input didn't match.
}
pos += 3;
slice = inputSpan.Slice(pos);
break;
default:
return false; // The input didn't match.
}
//}
if ((uint)slice.Length < 6 ||
slice[0] != ':' || // Match ':'.
!char.IsBetween(slice[1], '0', '5') || // Match a character in the set [0-5].
!char.IsAsciiDigit(slice[2]) || // Match a character in the set [0-9].
slice[3] != ':' || // Match ':'.
!char.IsBetween(slice[4], '0', '5') || // Match a character in the set [0-5].
!char.IsAsciiDigit(slice[5])) // Match a character in the set [0-9].
{
return false; // The input didn't match.
}
// Optional (greedy).
//{
pos += 6;
slice = inputSpan.Slice(pos);
loop_iteration = 0;
LoopBody:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos);
loop_iteration++;
// Match '.'.
if (slice.IsEmpty || slice[0] != '.')
{
goto LoopIterationNoMatch;
}
// Match a Unicode digit greedily at least 1 and at most 9 times.
//{
pos++;
slice = inputSpan.Slice(pos);
charloop_starting_pos = pos;
int iteration = 0;
while (iteration < 9 && (uint)iteration < (uint)slice.Length && char.IsDigit(slice[iteration]))
{
iteration++;
}
if (iteration == 0)
{
goto LoopIterationNoMatch;
}
slice = slice.Slice(iteration);
pos += iteration;
charloop_ending_pos = pos;
charloop_starting_pos++;
goto CharLoopEnd;
CharLoopBacktrack:
Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos, out charloop_starting_pos);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos >= charloop_ending_pos)
{
goto LoopIterationNoMatch;
}
pos = --charloop_ending_pos;
slice = inputSpan.Slice(pos);
CharLoopEnd:
Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos, charloop_ending_pos);
//}
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration == 0)
{
goto LoopBody;
}
goto LoopEnd;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch:
if (--loop_iteration < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
return false; // The input didn't match.
}
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
goto LoopEnd;
LoopBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (loop_iteration == 0)
{
// No iterations of the loop remain to backtrack into. Fail the loop.
return false; // The input didn't match.
}
goto CharLoopBacktrack;
LoopEnd:;
//}
// Atomic group.
{
int atomic_stackpos = stackpos;
// Optional (greedy).
//{
startingStackpos = stackpos;
loop_iteration1 = 0;
LoopBody1:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos);
loop_iteration1++;
// Match with 2 alternative expressions, atomically.
//{
int alternation_starting_pos = pos;
// Branch 0
{
// Match 'Z'.
if (slice.IsEmpty || slice[0] != 'Z')
{
goto AlternationBranch;
}
pos++;
slice = inputSpan.Slice(pos);
goto AlternationMatch;
AlternationBranch:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
}
// Branch 1
{
// Match a character in the set [+-Z].
if (slice.IsEmpty || (((ch = slice[0]) != '+') & (ch != '-') & (ch != 'Z')))
{
goto LoopIterationNoMatch1;
}
// Match with 2 alternative expressions.
//{
if ((uint)slice.Length < 2)
{
goto LoopIterationNoMatch1;
}
switch (slice[1])
{
case '0' or '1':
// Match a character in the set [0-9].
if ((uint)slice.Length < 3 || !char.IsAsciiDigit(slice[2]))
{
goto LoopIterationNoMatch1;
}
pos += 3;
slice = inputSpan.Slice(pos);
break;
case '2':
// Match a character in the set [0-3].
if ((uint)slice.Length < 3 || !char.IsBetween(slice[2], '0', '3'))
{
goto LoopIterationNoMatch1;
}
pos += 3;
slice = inputSpan.Slice(pos);
break;
default:
goto LoopIterationNoMatch1;
}
//}
if ((uint)slice.Length < 3 ||
slice[0] != ':' || // Match ':'.
!char.IsBetween(slice[1], '0', '5') || // Match a character in the set [0-5].
!char.IsAsciiDigit(slice[2])) // Match a character in the set [0-9].
{
goto LoopIterationNoMatch1;
}
pos += 3;
slice = inputSpan.Slice(pos);
}
AlternationMatch:;
//}
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration1 == 0)
{
goto LoopBody1;
}
goto LoopEnd1;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch1:
if (--loop_iteration1 < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
goto LoopBacktrack;
}
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
LoopEnd1:
stackpos = startingStackpos; // Ensure any remaining backtracking state is removed.
//}
stackpos = atomic_stackpos;
}
// 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.12.26602")]
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>Pops 2 values from the backtracking stack.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void StackPop(int[] stack, ref int pos, out int arg0, out int arg1)
{
arg0 = stack[--pos];
arg1 = stack[--pos];
}
/// <summary>Pushes 1 value onto the backtracking stack.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void StackPush(ref int[] stack, ref int pos, int arg0)
{
// If there's space available for the value, store it.
int[] s = stack;
int p = pos;
if ((uint)p < (uint)s.Length)
{
s[p] = arg0;
pos++;
return;
}
// Otherwise, resize the stack to make room and try again.
WithResize(ref stack, ref pos, arg0);
// <summary>Resize the backtracking stack array and push 1 value onto the stack.</summary>
[MethodImpl(MethodImplOptions.NoInlining)]
static void WithResize(ref int[] stack, ref int pos, int arg0)
{
Array.Resize(ref stack, (pos + 0) * 2);
StackPush(ref stack, ref pos, arg0);
}
}
/// <summary>Pushes 2 values onto the backtracking stack.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void StackPush(ref int[] stack, ref int pos, int arg0, int arg1)
{
// If there's space available for all 2 values, store them.
int[] s = stack;
int p = pos;
if ((uint)(p + 1) < (uint)s.Length)
{
s[p] = arg0;
s[p + 1] = arg1;
pos += 2;
return;
}
// Otherwise, resize the stack to make room and try again.
WithResize(ref stack, ref pos, arg0, arg1);
// <summary>Resize the backtracking stack array and push 2 values onto the stack.</summary>
[MethodImpl(MethodImplOptions.NoInlining)]
static void WithResize(ref int[] stack, ref int pos, int arg0, int arg1)
{
Array.Resize(ref stack, (pos + 1) * 2);
StackPush(ref stack, ref pos, arg0, arg1);
}
}
/// <summary>Pushes 3 values onto the backtracking stack.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void StackPush(ref int[] stack, ref int pos, int arg0, int arg1, int arg2)
{
// If there's space available for all 3 values, store them.
int[] s = stack;
int p = pos;
if ((uint)(p + 2) < (uint)s.Length)
{
s[p] = arg0;
s[p + 1] = arg1;
s[p + 2] = arg2;
pos += 3;
return;
}
// Otherwise, resize the stack to make room and try again.
WithResize(ref stack, ref pos, arg0, arg1, arg2);
// <summary>Resize the backtracking stack array and push 3 values onto the stack.</summary>
[MethodImpl(MethodImplOptions.NoInlining)]
static void WithResize(ref int[] stack, ref int pos, int arg0, int arg1, int arg2)
{
Array.Resize(ref stack, (pos + 2) * 2);
StackPush(ref stack, ref pos, arg0, arg1, arg2);
}
}
}
}
|