Regular Expressions 101

Community Patterns

Missing copyright detector for Rider (PCRE2)

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?s-i)\A(?!.*\QCopyright MyCompany Ltd. All Rights Reserved\E).+
/
gm

Description

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

Submitted by Kris Morness - 2 years ago