Regular Expressions 101

Community Patterns

123...6

Community Library Entry

0

Regular Expression
.NET 7.0 (C#)

@"
(?s-i)\A(?!.*\bCopyright MyCompany Ltd. All Rights Reserved\b).+
"
gm

Description

Detects one match per file if that file is missing the expected copyright text. This works with Visual Studio IDE. If you are using Rider (PCRE2), you can replace both \b entries with \Q then \E

Submitted by Kris Morness - 3 years ago