Created
July 15, 2022 05:32
-
-
Save EngRajabi/5c09f253098618fd28258a15e68a7058 to your computer and use it in GitHub Desktop.
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
public static partial class TestRegexSourceGenerator | |
{ | |
// The Source Generator generates the code of the method at compile time | |
[RegexGenerator(@"\d+", RegexOptions.Compiled, 50)] | |
private static partial Regex IsDigitRegex(); | |
public static bool IsDigit(string value) | |
{ | |
return IsDigitRegex().IsMatch(value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment