我要檢查一些java類代碼的頭部分,我使用的是maven-license-plugin,並且我必須在常見頭文件(文本)文件中指定常規表達允許這樣的臺詞:正則表達式來匹配複雜的字符串或行
Portions Copyrighted 2013 andrea
或
Copyright 2008-2009 Company, Inc. All rights reserved.
你能幫助我嗎?
頭的模板是:
====================
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2008-2009 company, Inc. All rights reserved.
The contents of this file are subject to the terms of the Common Development
and Distribution License("CDDL") (the "License"). You may not use this file
except in compliance with the License.
You can obtain a copy of the License at https://xxx.yy.com/licenses/CDDL
See the License for the specific language governing permissions and limitations
under the License.
When distributing the Covered Code, include this CDDL Header Notice in each file
and include the License file at https://xxx.yy.com/licenses/CDDL.
If applicable, add the following below this CDDL Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
====================
你可以說說規則嗎?比如哪個字符沒有改變,哪些字符會改變? –
,我必須能夠識別所發佈的模板以及文件末尾的一行,例如部分版權所有2013 andrea以及第一版權之後的附加行:Copyright 2008-2009 Company,Inc.保留所有權利。 – andPat
對這個模板的唯一更改是這兩個可能的添加,整個剩餘的文本是相同的 – andPat