我有一個匹配用正則表達式這樣的文字:有沒有辦法在正則表達式中排除單詞或語音?
====================
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://oss.oracle.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://oss.oracle.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]"
====================
Copyright 2011-2013 Company. All rights reserved.
,並靜從不改變===========之間的部分,這樣我就可以搜索此表達式以靜態的方式表達,但它不是一個格式良好的正則表達式,我怎樣才能使正則表達式中的靜態===========之間的所有文本?
這完全取決於您正在使用的編程語言。哪一個? –
也許是基本的正則表達式格式:'\ = {22} [^ \ =] * \ = {22}'? – 2013-06-28 12:38:31
如果文本是靜態的,請不要使用正則表達式,但嚴格相等。 – Toto