|
// <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.Hosting.Dashboard
{
partial class DashboardService
{
/// <remarks>
/// Pattern:<br/>
/// <code>^(?<name>.+?)\\.?AppHost$</code><br/>
/// Options:<br/>
/// <code>RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.CultureInvariant</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Match if at the beginning of the string.<br/>
/// ○ "name" capture group.<br/>
/// ○ Match any character lazily at least once.<br/>
/// ○ Match '.' atomically, optionally.<br/>
/// ○ Match a character in the set [Aa].<br/>
/// ○ Match a character in the set [Pp] exactly 2 times.<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 if at the end of the string or if before an ending newline.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex ApplicationNameRegex() => global::System.Text.RegularExpressions.Generated.ApplicationNameRegex_0.Instance;
}
}
namespace Aspire.Hosting.Dcp
{
partial class DcpDependencyCheck
{
/// <remarks>
/// Pattern:<br/>
/// <code>[^\\d\\.].*$</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Match a character in the set [^.\d].<br/>
/// ○ Match a character other than '\n' greedily any number of times.<br/>
/// ○ Match if at the end of the string or if before an ending newline.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex VersionRegex() => global::System.Text.RegularExpressions.Generated.VersionRegex_1.Instance;
}
}
namespace Aspire.Hosting.Dcp
{
partial class DcpExecutor
{
/// <remarks>
/// Pattern:<br/>
/// <code>^(?<name>.+?)\\.?AppHost$</code><br/>
/// Options:<br/>
/// <code>RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.CultureInvariant</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Match if at the beginning of the string.<br/>
/// ○ "name" capture group.<br/>
/// ○ Match any character lazily at least once.<br/>
/// ○ Match '.' atomically, optionally.<br/>
/// ○ Match a character in the set [Aa].<br/>
/// ○ Match a character in the set [Pp] exactly 2 times.<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 if at the end of the string or if before an ending newline.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex ApplicationNameRegex() => global::System.Text.RegularExpressions.Generated.ApplicationNameRegex_0.Instance;
}
}
namespace Aspire.Hosting.Utils
{
partial class ContainerReferenceParser
{
/// <remarks>
/// Pattern:<br/>
/// <code>^((?<registry>((localhost|\\[(?:[a-fA-F0-9:]+)\\]|([\\w-]+(\\.[\\w-]+)+))(:\\d+)?)|([\\w-]+:\\d+))\\/)?(?<image>[\\w-./<>]+)(:(?<tag>[\\w-.<>]+))?(@(?<digest>.+))?$</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Match if at the beginning of the string.<br/>
/// ○ Optional (greedy).<br/>
/// ○ 1st capture group.<br/>
/// ○ "registry" capture group.<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ 2nd capture group.<br/>
/// ○ 3rd capture group.<br/>
/// ○ Match with 3 alternative expressions.<br/>
/// ○ Match the string "localhost".<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match '['.<br/>
/// ○ Match a character in the set [0-:A-Fa-f] atomically at least once.<br/>
/// ○ Match ']'.<br/>
/// ○ 4th capture group.<br/>
/// ○ Match a character in the set [-\w] atomically at least once.<br/>
/// ○ Loop greedily at least once.<br/>
/// ○ 5th capture group.<br/>
/// ○ Match '.'.<br/>
/// ○ Match a character in the set [-\w] greedily at least once.<br/>
/// ○ Optional (greedy).<br/>
/// ○ 6th capture group.<br/>
/// ○ Match ':'.<br/>
/// ○ Match a Unicode digit atomically at least once.<br/>
/// ○ 7th capture group.<br/>
/// ○ Match a character in the set [-\w] atomically at least once.<br/>
/// ○ Match ':'.<br/>
/// ○ Match a Unicode digit atomically at least once.<br/>
/// ○ Match '/'.<br/>
/// ○ "image" capture group.<br/>
/// ○ Match a character in the set [--/<>\w] greedily at least once.<br/>
/// ○ Optional (greedy).<br/>
/// ○ 8th capture group.<br/>
/// ○ Match ':'.<br/>
/// ○ "tag" capture group.<br/>
/// ○ Match a character in the set [-.<>\w] greedily at least once.<br/>
/// ○ Optional (greedy).<br/>
/// ○ 9th capture group.<br/>
/// ○ Match '@'.<br/>
/// ○ "digest" capture group.<br/>
/// ○ Match a character other than '\n' greedily at least once.<br/>
/// ○ Match if at the end of the string or if before an ending newline.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
private static partial global::System.Text.RegularExpressions.Regex ImageNameRegex() => global::System.Text.RegularExpressions.Generated.ImageNameRegex_2.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_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 ApplicationNameRegex method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
[SkipLocalsInit]
file sealed class ApplicationNameRegex_0 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly ApplicationNameRegex_0 Instance = new();
/// <summary>Initializes the instance.</summary>
private ApplicationNameRegex_0()
{
base.pattern = "^(?<name>.+?)\\.?AppHost$";
base.roptions = RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.CultureInvariant;
ValidateMatchTimeout(Utilities.s_defaultTimeout);
base.internalMatchTimeout = Utilities.s_defaultTimeout;
base.factory = new RunnerFactory();
base.CapNames = new Hashtable { { "0", 0 } , { "name", 1 } };
base.capslist = new string[] {"0", "name" };
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;
// Any possible match is at least 8 characters.
if (pos <= inputSpan.Length - 8)
{
// 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 lazyloop_capturepos = 0;
int lazyloop_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.
}
// "name" capture group.
//{
capture_starting_pos = pos;
// Match any character lazily at least once.
//{
if (slice.IsEmpty || false)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
pos++;
slice = inputSpan.Slice(pos);
lazyloop_pos = pos;
goto LazyLoopEnd;
LazyLoopBacktrack:
UncaptureUntil(lazyloop_capturepos);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
pos = lazyloop_pos;
slice = inputSpan.Slice(pos);
if (slice.IsEmpty || false)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
pos++;
slice = inputSpan.Slice(pos);
lazyloop_pos = pos;
LazyLoopEnd:
lazyloop_capturepos = base.Crawlpos();
//}
base.Capture(1, capture_starting_pos, pos);
goto CaptureSkipBacktrack;
CaptureBacktrack:
goto LazyLoopBacktrack;
CaptureSkipBacktrack:;
//}
// Match '.' atomically, optionally.
{
if (!slice.IsEmpty && slice[0] == '.')
{
slice = slice.Slice(1);
pos++;
}
}
if ((uint)slice.Length < 7 ||
!slice.StartsWith("apphost", StringComparison.OrdinalIgnoreCase)) // Match the string "apphost" (ordinal case-insensitive)
{
goto CaptureBacktrack;
}
// Match if at the end of the string or if before an ending newline.
if (8 < slice.Length || (7 < slice.Length && slice[7] != '\n'))
{
goto CaptureBacktrack;
}
// The input matched.
pos += 7;
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 VersionRegex method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
[SkipLocalsInit]
file sealed class VersionRegex_1 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly VersionRegex_1 Instance = new();
/// <summary>Initializes the instance.</summary>
private VersionRegex_1()
{
base.pattern = "[^\\d\\.].*$";
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 [^.\d].
// Find the next occurrence. If it can't be found, there's no match.
int i = inputSpan.Slice(pos).IndexOfNonAsciiOrAny_CC5DD796C5DC14AB3843B0392E0C498637CD32EDEC8D181AE0E31F1F9AD7CD47();
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 charloop_starting_pos = 0, charloop_ending_pos = 0;
ReadOnlySpan<char> slice = inputSpan.Slice(pos);
// Match a character in the set [^.\d].
if (slice.IsEmpty || ((ch = slice[0]) < 128 ? ("\uffff\uffff뿿ﰀ\uffff\uffff\uffff\uffff"[ch >> 4] & (1 << (ch & 0xF))) == 0 : !RegexRunner.CharInClass((char)ch, "\u0001\u0002\u0001./\t")))
{
return false; // The input didn't match.
}
// Match a character other than '\n' greedily any number of times.
//{
pos++;
slice = inputSpan.Slice(pos);
charloop_starting_pos = pos;
int iteration = slice.IndexOf('\n');
if (iteration < 0)
{
iteration = slice.Length;
}
slice = slice.Slice(iteration);
pos += iteration;
charloop_ending_pos = pos;
goto CharLoopEnd;
CharLoopBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos >= charloop_ending_pos)
{
return false; // The input didn't match.
}
pos = --charloop_ending_pos;
slice = inputSpan.Slice(pos);
CharLoopEnd:
//}
// Match if at the end of the string or if before an ending newline.
if (pos < inputSpan.Length - 1 || ((uint)pos < (uint)inputSpan.Length && inputSpan[pos] != '\n'))
{
goto CharLoopBacktrack;
}
// The input matched.
base.runtextpos = pos;
base.Capture(0, matchStart, pos);
return true;
}
}
}
}
/// <summary>Custom <see cref="Regex"/>-derived type for the ImageNameRegex method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.12.26602")]
[SkipLocalsInit]
file sealed class ImageNameRegex_2 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly ImageNameRegex_2 Instance = new();
/// <summary>Initializes the instance.</summary>
private ImageNameRegex_2()
{
base.pattern = "^((?<registry>((localhost|\\[(?:[a-fA-F0-9:]+)\\]|([\\w-]+(\\.[\\w-]+)+))(:\\d+)?)|([\\w-]+:\\d+))\\/)?(?<image>[\\w-./<>]+)(:(?<tag>[\\w-.<>]+))?(@(?<digest>.+))?$";
base.roptions = RegexOptions.None;
ValidateMatchTimeout(Utilities.s_defaultTimeout);
base.internalMatchTimeout = Utilities.s_defaultTimeout;
base.factory = new RunnerFactory();
base.CapNames = new Hashtable { { "0", 0 } , { "1", 1 } , { "2", 2 } , { "3", 3 } , { "4", 4 } , { "5", 5 } , { "6", 6 } , { "7", 7 } , { "8", 8 } , { "9", 9 } , { "digest", 13 } , { "image", 11 } , { "registry", 10 } , { "tag", 12 } };
base.capslist = new string[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "registry", "image", "tag", "digest" };
base.capsize = 14;
}
/// <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_pos8 = 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 charloop_starting_pos2 = 0, charloop_ending_pos2 = 0;
int charloop_starting_pos3 = 0, charloop_ending_pos3 = 0;
int loop_iteration = 0;
int loop_iteration1 = 0;
int loop_iteration2 = 0;
int loop_iteration3 = 0;
int loop_iteration4 = 0;
int stackpos = 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.
}
// Optional (greedy).
//{
loop_iteration = 0;
LoopBody:
Utilities.StackPush(ref base.runstack!, ref stackpos, base.Crawlpos(), pos);
loop_iteration++;
// 1st capture group.
//{
int capture_starting_pos = pos;
// "registry" capture group.
//{
int capture_starting_pos1 = pos;
// Match with 2 alternative expressions.
//{
int alternation_starting_pos = pos;
int alternation_starting_capturepos = base.Crawlpos();
// Branch 0
//{
// 2nd capture group.
//{
int capture_starting_pos2 = pos;
// 3rd capture group.
//{
int capture_starting_pos3 = pos;
// Match with 3 alternative expressions.
//{
int alternation_starting_pos1 = pos;
int alternation_starting_capturepos1 = base.Crawlpos();
// Branch 0
//{
// Match the string "localhost".
if (!slice.StartsWith("localhost"))
{
goto AlternationBranch1;
}
Utilities.StackPush(ref base.runstack!, ref stackpos, 0, alternation_starting_pos1, alternation_starting_capturepos1);
pos += 9;
slice = inputSpan.Slice(pos);
goto AlternationMatch1;
AlternationBranch1:
pos = alternation_starting_pos1;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos1);
//}
// Branch 1
//{
// Match '['.
if (slice.IsEmpty || slice[0] != '[')
{
goto AlternationBranch2;
}
// Match a character in the set [0-:A-Fa-f] atomically at least once.
{
int iteration = slice.Slice(1).IndexOfAnyExcept(Utilities.s_ascii_FF077E0000007E000000);
if (iteration < 0)
{
iteration = slice.Length - 1;
}
if (iteration == 0)
{
goto AlternationBranch2;
}
slice = slice.Slice(iteration);
pos += iteration;
}
// Match ']'.
if ((uint)slice.Length < 2 || slice[1] != ']')
{
goto AlternationBranch2;
}
Utilities.StackPush(ref base.runstack!, ref stackpos, 1, alternation_starting_pos1, alternation_starting_capturepos1);
pos += 2;
slice = inputSpan.Slice(pos);
goto AlternationMatch1;
AlternationBranch2:
pos = alternation_starting_pos1;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos1);
//}
// Branch 2
//{
// 4th capture group.
//{
int capture_starting_pos4 = pos;
// Match a character in the set [-\w] atomically at least once.
{
int iteration1 = 0;
while ((uint)iteration1 < (uint)slice.Length && ((ch = slice[iteration1]) < 128 ? ("\0\0 Ͽ\ufffe蟿\ufffe߿"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\0\u0002\n-.\0\u0002\u0004\u0005\u0003\u0001\u0006\t\u0013\0")))
{
iteration1++;
}
if (iteration1 == 0)
{
goto AlternationBranch;
}
slice = slice.Slice(iteration1);
pos += iteration1;
}
// Loop greedily at least once.
//{
loop_iteration1 = 0;
LoopBody1:
Utilities.StackPush(ref base.runstack!, ref stackpos, base.Crawlpos(), pos);
loop_iteration1++;
// 5th capture group.
//{
int capture_starting_pos5 = pos;
// Match '.'.
if (slice.IsEmpty || slice[0] != '.')
{
goto LoopIterationNoMatch1;
}
// Match a character in the set [-\w] greedily at least once.
//{
pos++;
slice = inputSpan.Slice(pos);
charloop_starting_pos = pos;
int iteration2 = 0;
while ((uint)iteration2 < (uint)slice.Length && ((ch = slice[iteration2]) < 128 ? ("\0\0 Ͽ\ufffe蟿\ufffe߿"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\0\u0002\n-.\0\u0002\u0004\u0005\u0003\u0001\u0006\t\u0013\0")))
{
iteration2++;
}
if (iteration2 == 0)
{
goto LoopIterationNoMatch1;
}
slice = slice.Slice(iteration2);
pos += iteration2;
charloop_ending_pos = pos;
charloop_starting_pos++;
goto CharLoopEnd;
CharLoopBacktrack:
UncaptureUntil(base.runstack![--stackpos]);
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 LoopIterationNoMatch1;
}
pos = --charloop_ending_pos;
slice = inputSpan.Slice(pos);
CharLoopEnd:
Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos, charloop_ending_pos, base.Crawlpos());
//}
base.Capture(5, capture_starting_pos5, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos5);
goto CaptureSkipBacktrack;
CaptureBacktrack:
capture_starting_pos5 = base.runstack![--stackpos];
goto CharLoopBacktrack;
CaptureSkipBacktrack:;
//}
// The loop has no upper bound. Continue iterating greedily.
goto LoopBody1;
// 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 AlternationBranch;
}
pos = base.runstack![--stackpos];
UncaptureUntil(base.runstack![--stackpos]);
slice = inputSpan.Slice(pos);
if (loop_iteration1 == 0)
{
// No iterations have been matched to backtrack into. Fail the loop.
goto AlternationBranch;
}
goto LoopEnd1;
LoopBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (loop_iteration1 == 0)
{
// No iterations of the loop remain to backtrack into. Fail the loop.
goto AlternationBranch;
}
goto CaptureBacktrack;
LoopEnd1:
Utilities.StackPush(ref base.runstack!, ref stackpos, loop_iteration1);
goto LoopSkipBacktrack;
LoopBacktrack1:
loop_iteration1 = base.runstack![--stackpos];
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
goto LoopBacktrack;
LoopSkipBacktrack:;
//}
base.Capture(4, capture_starting_pos4, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos4);
goto CaptureSkipBacktrack1;
CaptureBacktrack1:
capture_starting_pos4 = base.runstack![--stackpos];
goto LoopBacktrack1;
CaptureSkipBacktrack1:;
//}
Utilities.StackPush(ref base.runstack!, ref stackpos, 2, alternation_starting_pos1, alternation_starting_capturepos1);
goto AlternationMatch1;
//}
AlternationBacktrack1:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
Utilities.StackPop(base.runstack!, ref stackpos, out alternation_starting_capturepos1, out alternation_starting_pos1);
switch (base.runstack![--stackpos])
{
case 0:
goto AlternationBranch1;
case 1:
goto AlternationBranch2;
case 2:
goto CaptureBacktrack1;
}
AlternationMatch1:;
//}
base.Capture(3, capture_starting_pos3, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos3);
goto CaptureSkipBacktrack2;
CaptureBacktrack2:
capture_starting_pos3 = base.runstack![--stackpos];
goto AlternationBacktrack1;
CaptureSkipBacktrack2:;
//}
// Optional (greedy).
//{
loop_iteration2 = 0;
LoopBody2:
Utilities.StackPush(ref base.runstack!, ref stackpos, base.Crawlpos(), pos);
loop_iteration2++;
// 6th capture group.
{
int capture_starting_pos6 = pos;
// Match ':'.
if (slice.IsEmpty || slice[0] != ':')
{
goto LoopIterationNoMatch2;
}
// Match a Unicode digit atomically at least once.
{
pos++;
slice = inputSpan.Slice(pos);
int iteration3 = 0;
while ((uint)iteration3 < (uint)slice.Length && char.IsDigit(slice[iteration3]))
{
iteration3++;
}
if (iteration3 == 0)
{
goto LoopIterationNoMatch2;
}
slice = slice.Slice(iteration3);
pos += iteration3;
}
base.Capture(6, capture_starting_pos6, pos);
}
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration2 == 0)
{
goto LoopBody2;
}
goto LoopEnd2;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch2:
if (--loop_iteration2 < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
goto CaptureBacktrack2;
}
pos = base.runstack![--stackpos];
UncaptureUntil(base.runstack![--stackpos]);
slice = inputSpan.Slice(pos);
LoopEnd2:
Utilities.StackPush(ref base.runstack!, ref stackpos, loop_iteration2);
goto LoopSkipBacktrack1;
LoopBacktrack2:
loop_iteration2 = base.runstack![--stackpos];
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
goto LoopIterationNoMatch2;
LoopSkipBacktrack1:;
//}
base.Capture(2, capture_starting_pos2, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos2);
goto CaptureSkipBacktrack3;
CaptureBacktrack3:
capture_starting_pos2 = base.runstack![--stackpos];
goto LoopBacktrack2;
CaptureSkipBacktrack3:;
//}
Utilities.StackPush(ref base.runstack!, ref stackpos, 0, alternation_starting_pos, alternation_starting_capturepos);
goto AlternationMatch;
AlternationBranch:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos);
//}
// Branch 1
//{
// 7th capture group.
{
int capture_starting_pos7 = pos;
// Match a character in the set [-\w] atomically at least once.
{
int iteration4 = 0;
while ((uint)iteration4 < (uint)slice.Length && ((ch = slice[iteration4]) < 128 ? ("\0\0 Ͽ\ufffe蟿\ufffe߿"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\0\u0002\n-.\0\u0002\u0004\u0005\u0003\u0001\u0006\t\u0013\0")))
{
iteration4++;
}
if (iteration4 == 0)
{
goto LoopIterationNoMatch;
}
slice = slice.Slice(iteration4);
pos += iteration4;
}
// Match ':'.
if (slice.IsEmpty || slice[0] != ':')
{
goto LoopIterationNoMatch;
}
// Match a Unicode digit atomically at least once.
{
pos++;
slice = inputSpan.Slice(pos);
int iteration5 = 0;
while ((uint)iteration5 < (uint)slice.Length && char.IsDigit(slice[iteration5]))
{
iteration5++;
}
if (iteration5 == 0)
{
goto LoopIterationNoMatch;
}
slice = slice.Slice(iteration5);
pos += iteration5;
}
base.Capture(7, capture_starting_pos7, pos);
}
Utilities.StackPush(ref base.runstack!, ref stackpos, 1, alternation_starting_pos, alternation_starting_capturepos);
goto AlternationMatch;
//}
AlternationBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
Utilities.StackPop(base.runstack!, ref stackpos, out alternation_starting_capturepos, out alternation_starting_pos);
switch (base.runstack![--stackpos])
{
case 0:
goto CaptureBacktrack3;
case 1:
goto LoopIterationNoMatch;
}
AlternationMatch:;
//}
base.Capture(10, capture_starting_pos1, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos1);
goto CaptureSkipBacktrack4;
CaptureBacktrack4:
capture_starting_pos1 = base.runstack![--stackpos];
goto AlternationBacktrack;
CaptureSkipBacktrack4:;
//}
// Match '/'.
if (slice.IsEmpty || slice[0] != '/')
{
goto CaptureBacktrack4;
}
pos++;
slice = inputSpan.Slice(pos);
base.Capture(1, capture_starting_pos, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos);
goto CaptureSkipBacktrack5;
CaptureBacktrack5:
capture_starting_pos = base.runstack![--stackpos];
goto CaptureBacktrack4;
CaptureSkipBacktrack5:;
//}
// 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.
UncaptureUntil(0);
return false; // The input didn't match.
}
pos = base.runstack![--stackpos];
UncaptureUntil(base.runstack![--stackpos]);
slice = inputSpan.Slice(pos);
goto LoopEnd;
LoopBacktrack3:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (loop_iteration == 0)
{
// No iterations of the loop remain to backtrack into. Fail the loop.
UncaptureUntil(0);
return false; // The input didn't match.
}
goto CaptureBacktrack5;
LoopEnd:;
//}
// "image" capture group.
//{
capture_starting_pos8 = pos;
// Match a character in the set [--/<>\w] greedily at least once.
//{
charloop_starting_pos1 = pos;
int iteration6 = 0;
while ((uint)iteration6 < (uint)slice.Length && ((ch = slice[iteration6]) < 128 ? ("\0\0叿\ufffe蟿\ufffe߿"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\0\u0006\n-0<=>?\0\u0002\u0004\u0005\u0003\u0001\u0006\t\u0013\0")))
{
iteration6++;
}
if (iteration6 == 0)
{
goto LoopBacktrack3;
}
slice = slice.Slice(iteration6);
pos += iteration6;
charloop_ending_pos1 = pos;
charloop_starting_pos1++;
goto CharLoopEnd1;
CharLoopBacktrack1:
UncaptureUntil(charloop_capture_pos);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos1 >= charloop_ending_pos1)
{
goto LoopBacktrack3;
}
pos = --charloop_ending_pos1;
slice = inputSpan.Slice(pos);
CharLoopEnd1:
charloop_capture_pos = base.Crawlpos();
//}
base.Capture(11, capture_starting_pos8, pos);
goto CaptureSkipBacktrack6;
CaptureBacktrack6:
goto CharLoopBacktrack1;
CaptureSkipBacktrack6:;
//}
// Optional (greedy).
//{
loop_iteration3 = 0;
LoopBody3:
Utilities.StackPush(ref base.runstack!, ref stackpos, base.Crawlpos(), pos);
loop_iteration3++;
// 8th capture group.
//{
int capture_starting_pos9 = pos;
// Match ':'.
if (slice.IsEmpty || slice[0] != ':')
{
goto LoopIterationNoMatch3;
}
// "tag" capture group.
//{
pos++;
slice = inputSpan.Slice(pos);
int capture_starting_pos10 = pos;
// Match a character in the set [-.<>\w] greedily at least once.
//{
charloop_starting_pos2 = pos;
int iteration7 = 0;
while ((uint)iteration7 < (uint)slice.Length && ((ch = slice[iteration7]) < 128 ? ("\0\0怀叿\ufffe蟿\ufffe߿"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\0\u0006\n-/<=>?\0\u0002\u0004\u0005\u0003\u0001\u0006\t\u0013\0")))
{
iteration7++;
}
if (iteration7 == 0)
{
goto LoopIterationNoMatch3;
}
slice = slice.Slice(iteration7);
pos += iteration7;
charloop_ending_pos2 = pos;
charloop_starting_pos2++;
goto CharLoopEnd2;
CharLoopBacktrack2:
UncaptureUntil(base.runstack![--stackpos]);
Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos2, out charloop_starting_pos2);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos2 >= charloop_ending_pos2)
{
goto LoopIterationNoMatch3;
}
pos = --charloop_ending_pos2;
slice = inputSpan.Slice(pos);
CharLoopEnd2:
Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos2, charloop_ending_pos2, base.Crawlpos());
//}
base.Capture(12, capture_starting_pos10, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos10);
goto CaptureSkipBacktrack7;
CaptureBacktrack7:
capture_starting_pos10 = base.runstack![--stackpos];
goto CharLoopBacktrack2;
CaptureSkipBacktrack7:;
//}
base.Capture(8, capture_starting_pos9, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos9);
goto CaptureSkipBacktrack8;
CaptureBacktrack8:
capture_starting_pos9 = base.runstack![--stackpos];
goto CaptureBacktrack7;
CaptureSkipBacktrack8:;
//}
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration3 == 0)
{
goto LoopBody3;
}
goto LoopEnd3;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch3:
if (--loop_iteration3 < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
goto CaptureBacktrack6;
}
pos = base.runstack![--stackpos];
UncaptureUntil(base.runstack![--stackpos]);
slice = inputSpan.Slice(pos);
goto LoopEnd3;
LoopBacktrack4:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (loop_iteration3 == 0)
{
// No iterations of the loop remain to backtrack into. Fail the loop.
goto CaptureBacktrack6;
}
goto CaptureBacktrack8;
LoopEnd3:;
//}
// Optional (greedy).
//{
loop_iteration4 = 0;
LoopBody4:
Utilities.StackPush(ref base.runstack!, ref stackpos, base.Crawlpos(), pos);
loop_iteration4++;
// 9th capture group.
//{
int capture_starting_pos11 = pos;
// Match '@'.
if (slice.IsEmpty || slice[0] != '@')
{
goto LoopIterationNoMatch4;
}
// "digest" capture group.
//{
pos++;
slice = inputSpan.Slice(pos);
int capture_starting_pos12 = pos;
// Match a character other than '\n' greedily at least once.
//{
charloop_starting_pos3 = pos;
int iteration8 = slice.IndexOf('\n');
if (iteration8 < 0)
{
iteration8 = slice.Length;
}
if (iteration8 == 0)
{
goto LoopIterationNoMatch4;
}
slice = slice.Slice(iteration8);
pos += iteration8;
charloop_ending_pos3 = pos;
charloop_starting_pos3++;
goto CharLoopEnd3;
CharLoopBacktrack3:
UncaptureUntil(base.runstack![--stackpos]);
Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos3, out charloop_starting_pos3);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos3 >= charloop_ending_pos3)
{
goto LoopIterationNoMatch4;
}
pos = --charloop_ending_pos3;
slice = inputSpan.Slice(pos);
CharLoopEnd3:
Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos3, charloop_ending_pos3, base.Crawlpos());
//}
base.Capture(13, capture_starting_pos12, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos12);
goto CaptureSkipBacktrack9;
CaptureBacktrack9:
capture_starting_pos12 = base.runstack![--stackpos];
goto CharLoopBacktrack3;
CaptureSkipBacktrack9:;
//}
base.Capture(9, capture_starting_pos11, pos);
Utilities.StackPush(ref base.runstack!, ref stackpos, capture_starting_pos11);
goto CaptureSkipBacktrack10;
CaptureBacktrack10:
capture_starting_pos11 = base.runstack![--stackpos];
goto CaptureBacktrack9;
CaptureSkipBacktrack10:;
//}
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration4 == 0)
{
goto LoopBody4;
}
goto LoopEnd4;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch4:
if (--loop_iteration4 < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
goto LoopBacktrack4;
}
pos = base.runstack![--stackpos];
UncaptureUntil(base.runstack![--stackpos]);
slice = inputSpan.Slice(pos);
goto LoopEnd4;
LoopBacktrack5:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (loop_iteration4 == 0)
{
// No iterations of the loop remain to backtrack into. Fail the loop.
goto LoopBacktrack4;
}
goto CaptureBacktrack10;
LoopEnd4:;
//}
// Match if at the end of the string or if before an ending newline.
if (pos < inputSpan.Length - 1 || ((uint)pos < (uint)inputSpan.Length && inputSpan[pos] != '\n'))
{
goto LoopBacktrack5;
}
// 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")]
[SkipLocalsInit]
file sealed class GenerateRfc3339RegEx_3 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly GenerateRfc3339RegEx_3 Instance = new();
/// <summary>Initializes the instance.</summary>
private GenerateRfc3339RegEx_3()
{
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>Finds the next index of any character that matches a character in the set [^.\d].</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static int IndexOfNonAsciiOrAny_CC5DD796C5DC14AB3843B0392E0C498637CD32EDEC8D181AE0E31F1F9AD7CD47(this ReadOnlySpan<char> span)
{
int i = span.IndexOfAnyExcept(Utilities.s_ascii_40FF030000000000000000);
if ((uint)i < (uint)span.Length)
{
if (char.IsAscii(span[i]))
{
return i;
}
char ch;
do
{
if (((ch = span[i]) < 128 ? ("\uffff\uffff뿿ﰀ\uffff\uffff\uffff\uffff"[ch >> 4] & (1 << (ch & 0xF))) != 0 : RegexRunner.CharInClass((char)ch, "\u0001\u0002\u0001./\t")))
{
return i;
}
i++;
}
while ((uint)i < (uint)span.Length);
}
return -1;
}
/// <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);
}
}
/// <summary>Supports searching for characters in or not in ".0123456789".</summary>
internal static readonly SearchValues<char> s_ascii_40FF030000000000000000 = SearchValues.Create(".0123456789");
/// <summary>Supports searching for characters in or not in "0123456789:ABCDEFabcdef".</summary>
internal static readonly SearchValues<char> s_ascii_FF077E0000007E000000 = SearchValues.Create("0123456789:ABCDEFabcdef");
}
}
|