正确的正则表达式,用于查找包含两个或三个单词的字符串

时间:2018-05-21 18:11:48

标签: regex python-3.x python-2.7 regex-lookarounds lookbehind

我有一个给出的文字:

(3) Reflects the adoption of SFAS No. 128, EARNINGS PER SHARE.

<PAGE>

ITEM 7. MANAGEMENT'S DISCUSSION AND ANALYSIS OF FINANCIAL CONDITION AND RESULTS
        OF OPERATION


YEAR ENDED DECEMBER 28, 1997 COMPARED TO THE YEAR ENDED DECEMBER 29, 1996


In November 1996, the Company initiated a major restructuring and growth
plan designed to substantially reduce its cost structure and grow the business
in order to restore higher levels of profitability for the Company. By July
1997, the Company completed the major phases of the restructuring plan. The
$225.0 million of annualized cost savings anticipated from the restructuring
results primarily from the consolidation of administrative functions within 

在这里,我想提取"MANAGEMENT'S DISCUSSION AND ANALYSIS"之后发生的<PAGE>。文档中还有许多其他"MANAGEMENT'S DISCUSSION AND ANALYSIS"(我没有复制文档,因为它长达1000多页)。

我使用了以下Regex表达式:

pattern = ('?<=<PAGE>')('.*')('?=Management\'s Discussion')

但是它给出了这个错误

TypeError: 'str' object is not callable

错误,在哪里以及如何纠正它?

0 个答案:

没有答案