Open vsfeedback opened 2 weeks ago
This issue has been moved from a ticket on Developer Community.
Create the following class:
public static class Foo { public static readonly Regex IllegalCharactersRegex = new("[" + @"\/:<>|" + "\"]", RegexOptions.Compiled); }
The quick fix suggest to convert the regex to 'GeneratedRegexAttribute'.
If you do, it generates the following code :
public static partial class Foo { public static readonly Regex IllegalCharactersRegex = MyRegex(); [GeneratedRegex(@"[\/:<>|"]", RegexOptions.Compiled)] private static partial Regex MyRegex(); }
But the string is badly formed. It should be @"[\/:<>|""]" instead.
(private comment, text removed)
(no solutions)
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions See info in area-owners.md if you want to be subscribed.
This issue has been moved from a ticket on Developer Community.
Create the following class:
The quick fix suggest to convert the regex to 'GeneratedRegexAttribute'.
If you do, it generates the following code :
But the string is badly formed. It should be @"[\/:<>|""]" instead.
Original Comments
Feedback Bot on 6/16/2024, 11:03 PM:
(private comment, text removed)
Original Solutions
(no solutions)