getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
604 stars 206 forks source link

Add [GeneratedRegex] properties #3690

Open jamescrosswell opened 1 month ago

jamescrosswell commented 1 month ago

We've got lots of regexes defined as properties, with backing methods specifically because we had to use methods to leverage the source generated regexes. For example: https://github.com/getsentry/sentry-dotnet/blob/3e70c3126515c87b1851b6a9a7afd99ffbb9aeb7/src/Sentry/Internal/OriginHelper.cs#L8-L18

We should be able to tidy that code up now that [GeneratedRegex] can also be added to properties.