@@ -187,48 +187,63 @@ internal static class AssemblyVersion
187187 {
188188 internal static class CSharp
189189 {
190- public static Regex TriviaRegex { get ; } = new ( @"
191- /\*(.*?)\*/ # Block comments: matches /* ... */
192- |//(.*?)\r?\n # Line comments: matches // ... followed by a newline
193- |""((\\[^\n]|[^""\n])*)"" # Strings: matches "" ... "" including escaped quotes" ,
190+ public static Regex TriviaRegex { get ; } = new (
191+ """
192+ /\*(.*?)\*/ # Block comments: matches /* ... */
193+ |//(.*?)\r?\n # Line comments: matches // ... followed by a newline
194+ |"((\\[^\n]|[^"\n])*)" # Strings: matches " ... " including escaped quotes
195+ """ ,
194196 RegexOptions . Singleline | RegexOptions . IgnorePatternWhitespace | Options ) ;
195197
196- public static Regex AttributeRegex { get ; } = new ( @"(?x) # IgnorePatternWhitespace
197- \[\s*assembly\s*:\s* # The [assembly: part
198- (System\s*\.\s*Reflection\s*\.\s*)? # The System.Reflection. part (optional)
199- Assembly(File|Informational)?Version # The attribute AssemblyVersion, AssemblyFileVersion, or AssemblyInformationalVersion
200- \s*\(\s*\)\s*\] # End brackets ()]" ,
198+ public static Regex AttributeRegex { get ; } = new (
199+ """
200+ (?x) # IgnorePatternWhitespace
201+ \[\s*assembly\s*:\s* # The [assembly: part
202+ (System\s*\.\s*Reflection\s*\.\s*)? # The System.Reflection. part (optional)
203+ Assembly(File|Informational)?Version # The attribute AssemblyVersion, AssemblyFileVersion, or AssemblyInformationalVersion
204+ \s*\(\s*\)\s*\] # End brackets ()]
205+ """ ,
201206 RegexOptions . IgnorePatternWhitespace | Options ) ;
202207 }
203208
204209 internal static class FSharp
205210 {
206- public static Regex TriviaRegex { get ; } = new ( @"
207- /\*(.*?)\*/ # Block comments: matches /* ... */
208- |//(.*?)\r?\n # Line comments: matches // ... followed by a newline
209- |""((\\[^\n]|[^""\n])*)"" # Strings: matches "" ... "" including escaped quotes" ,
211+ public static Regex TriviaRegex { get ; } = new (
212+ """
213+ /\*(.*?)\*/ # Block comments: matches /* ... */
214+ |//(.*?)\r?\n # Line comments: matches // ... followed by a newline
215+ |"((\\[^\n]|[^"\n])*)" # Strings: matches " ... " including escaped quotes
216+ """ ,
210217 RegexOptions . Singleline | RegexOptions . IgnorePatternWhitespace | Options ) ;
211218
212- public static Regex AttributeRegex { get ; } = new ( @"(?x) # IgnorePatternWhitespace
213- \[\s*<\s*assembly\s*:\s* # The [<assembly: part
214- (System\s*\.\s*Reflection\s*\.\s*)? # The System.Reflection. part (optional)
215- Assembly(File|Informational)?Version # The attribute AssemblyVersion, AssemblyFileVersion, or AssemblyInformationalVersion
216- \s*\(\s*\)\s*>\s*\] # End brackets ()>]" ,
219+ public static Regex AttributeRegex { get ; } = new (
220+ """
221+ (?x) # IgnorePatternWhitespace
222+ \[\s*<\s*assembly\s*:\s* # The [<assembly: part
223+ (System\s*\.\s*Reflection\s*\.\s*)? # The System.Reflection. part (optional)
224+ Assembly(File|Informational)?Version # The attribute AssemblyVersion, AssemblyFileVersion, or AssemblyInformationalVersion
225+ \s*\(\s*\)\s*>\s*\] # End brackets ()>]
226+ """ ,
217227 RegexOptions . IgnorePatternWhitespace | Options ) ;
218228 }
219229
220230 internal static class VisualBasic
221231 {
222- public static Regex TriviaRegex { get ; } = new ( @"
223- '(.*?)\r?\n # Line comments: matches // ... followed by a newline
224- |""((\\[^\n]|[^""\n])*)"" # Strings: matches "" ... "" including escaped quotes" ,
232+ public static Regex TriviaRegex { get ; } = new (
233+ """
234+ '(.*?)\r?\n # Line comments: matches // ... followed by a newline
235+ |"((\\[^\n]|[^"\n])*)" # Strings: matches " ... " including escaped quotes
236+ """ ,
225237 RegexOptions . Singleline | RegexOptions . IgnorePatternWhitespace | Options ) ;
226238
227- public static Regex AttributeRegex { get ; } = new ( @"(?x) # IgnorePatternWhitespace
228- \<\s*Assembly\s*:\s* # The <Assembly: part
229- (System\s*\.\s*Reflection\s*\.\s*)? # The System.Reflection. part (optional)
230- Assembly(File|Informational)?Version # The attribute AssemblyVersion, AssemblyFileVersion, or AssemblyInformationalVersion
231- \s*\(\s*\)\s*\> # End brackets ()>" ,
239+ public static Regex AttributeRegex { get ; } = new (
240+ """
241+ (?x) # IgnorePatternWhitespace
242+ \<\s*Assembly\s*:\s* # The <Assembly: part
243+ (System\s*\.\s*Reflection\s*\.\s*)? # The System.Reflection. part (optional)
244+ Assembly(File|Informational)?Version # The attribute AssemblyVersion, AssemblyFileVersion, or AssemblyInformationalVersion
245+ \s*\(\s*\)\s*\> # End brackets ()>
246+ """ ,
232247 RegexOptions . IgnorePatternWhitespace | Options ) ;
233248 }
234249 }
0 commit comments