Support GeneratedRegex
Hi Joseph. You may already do this, but can LinqPad support .Net Regular Expression Source Generators?
https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-source-generators
I'm interested in the Regex side of things, ge.g
[GeneratedRegex("abc|def", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcOrDefGeneratedRegex();
private static void EvaluateText(string text)
{
if (AbcOrDefGeneratedRegex().IsMatch(text))
{
// Take action with matching text
}
}
3
votes
![](https://secure.gravatar.com/avatar/4ab2509d2e3e3d0c9eed5dc4f57d8b30?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
Matthias Vill commented
This may be possible to implement without full source generator support (which would really be awesome, too!) and would allow to easier experiment with parts of a regular csproj.