title | description | ms.date | f1_keywords | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SYSLIB diagnostics for regex source generation |
Learn about the regular expression source-generation analyzers that generate compile-time suggestions SYSLIB1040, SYSLIB1041, SYSLIB1042, SYSLIB1043, SYSLIB1044, and SYSLIB1045. |
11/07/2022 |
|
The following table shows the diagnostic IDs for regex source-generation analyzers in .NET 7 and later versions. SYSLIB1045
automatically alerts you to places that you can use source generation to generate the regular expression engine implementation at compile time. The remaining diagnostics alert you to errors related to usage of the source generator.
Diagnostic ID | Description |
---|---|
SYSLIB1040 |
Invalid xref:System.Text.RegularExpressions.GeneratedRegexAttribute usage. |
SYSLIB1041 |
Multiple xref:System.Text.RegularExpressions.GeneratedRegexAttribute attributes were applied to the same method, but only one is allowed. |
SYSLIB1042 |
The specified regular expression is invalid. |
SYSLIB1043 |
A xref:System.Text.RegularExpressions.GeneratedRegexAttribute method must be partial, parameterless, non-generic, and non-abstract, and return xref:System.Text.RegularExpressions.Regex. |
SYSLIB1044 |
The regex generator couldn't generate a complete source implementation for the specified regular expression due to an internal limitation. See the explanation in the generated source for more details. |
SYSLIB1045 |
Use xref:System.Text.RegularExpressions.GeneratedRegexAttribute to generate the regular expression implementation at compile time. |
For more information about source generation for regular expressions, see .NET regular expression source generators.
[!INCLUDE suppress-syslib-warning]