-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2323d6e
commit 60c41a0
Showing
5 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// <auto-generated /> | ||
|
||
#pragma warning disable | ||
|
||
#if (MEMORYREFERENCED && !NET7_0_OR_GREATER) | ||
|
||
using System; | ||
using System.IO; | ||
using System.Net.Http; | ||
using System.Text.RegularExpressions; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Link = System.ComponentModel.DescriptionAttribute; | ||
|
||
static partial class Polyfill | ||
{ | ||
/// <summary> | ||
/// Indicates whether the regular expression specified in the Regex constructor finds a match in a specified input span. | ||
/// </summary> | ||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns> | ||
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.ismatch#system-text-regularexpressions-regex-ismatch(system-readonlyspan((system-char))-system-int32)")] | ||
public static bool IsMatch(this Regex target, ReadOnlySpan<char> input, int startat) | ||
{ | ||
return target.IsMatch(input.ToString(), startat); | ||
} | ||
|
||
/// <summary> | ||
/// Indicates whether the regular expression specified in the Regex constructor finds a match in a specified input span. | ||
/// </summary> | ||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns> | ||
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.ismatch#system-text-regularexpressions-regex-ismatch(system-readonlyspan((system-char)))")] | ||
public static bool IsMatch(this Regex target, ReadOnlySpan<char> input) | ||
{ | ||
return target.IsMatch(input.ToString()); | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// <auto-generated /> | ||
|
||
#pragma warning disable | ||
#if MEMORYREFERENCED | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Text.RegularExpressions; | ||
using Link = System.ComponentModel.DescriptionAttribute; | ||
|
||
[ExcludeFromCodeCoverage] | ||
#if PolyPublic | ||
public | ||
#endif | ||
static partial class RegexPolyfill | ||
{ | ||
/// <summary> | ||
/// Indicates whether the specified regular expression finds a match in the specified input span, using the specified matching options and time-out interval. | ||
/// </summary> | ||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns> | ||
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.ismatch#system-text-regularexpressions-regex-ismatch(system-readonlyspan((system-char))-system-string-system-text-regularexpressions-regexoptions-system-timespan)")] | ||
public static bool IsMatch(ReadOnlySpan<char> input, string pattern, RegexOptions options, TimeSpan matchTimeout) | ||
{ | ||
#if NET7_0_OR_GREATER | ||
return Regex.IsMatch(input, pattern, options, matchTimeout); | ||
#else | ||
return Regex.IsMatch(input.ToString(), pattern, options, matchTimeout); | ||
#endif | ||
} | ||
|
||
/// <summary> | ||
/// Indicates whether the specified regular expression finds a match in the specified input span, using the specified matching options. | ||
/// </summary> | ||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns> | ||
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.ismatch#system-text-regularexpressions-regex-ismatch(system-readonlyspan((system-char))-system-string-system-text-regularexpressions-regexoptions)")] | ||
public static bool IsMatch(ReadOnlySpan<char> input, string pattern, System.Text.RegularExpressions.RegexOptions options) | ||
{ | ||
#if NET7_0_OR_GREATER | ||
return Regex.IsMatch(input, pattern, options); | ||
#else | ||
return Regex.IsMatch(input.ToString(), pattern, options); | ||
#endif | ||
} | ||
|
||
/// <summary> | ||
/// Indicates whether the specified regular expression finds a match in the specified input span. | ||
/// </summary> | ||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns> | ||
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.ismatch#system-text-regularexpressions-regex-ismatch(system-readonlyspan((system-char))-system-string)")] | ||
public static bool IsMatch(ReadOnlySpan<char> input, string pattern) | ||
{ | ||
#if NET7_0_OR_GREATER | ||
return Regex.IsMatch(input, pattern); | ||
#else | ||
return Regex.IsMatch(input.ToString(), pattern); | ||
#endif | ||
} | ||
} | ||
#endif |