diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs index f34cc2329d291b..08793ce85ca68c 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs @@ -22,6 +22,7 @@ public partial class Regex : ISerializable { internal const int MaxOptionShift = 11; + [StringSyntax(StringSyntaxAttribute.Regex)] protected internal string? pattern; // The string pattern provided protected internal RegexOptions roptions; // the top-level options from the options string protected internal RegexRunnerFactory? factory; // Factory used to create runner instances for executing the regex