私はテロの攻撃に関するいくつかの記事を掻き集めました。これらの記事から、特定の段落を抽出したいと思います。最初fullstopに - 「カイロ」:から、私はさらなる分析のために抽出したい何記事から段落を抽出する|正規表現
By DAVID D. KIRKPATRICK MARCH 18, 2015
Scenes from Tunisian state television showed confusion outside an art museum and Parliament on Wednesday after gunmen attacked.
CAIRO — Gunmen in military uniforms killed 19 people on Wednesday in a
midday attack on a museum in downtown Tunis, dealing a new blow to the tourist industry
that is vital to Tunisia as it struggles to consolidate the only transition to democracy
after the Arab Spring revolts.
Tunisian officials had initially said that the attackers took 10
hostages and killed nine people, including seven foreign visitors and two Tunisians.
この例では、行くのテキストです:
これは、記事のサンプルでは、掻き取り。私が思いついた
This is the regular expression
:この正規表現で([A-Z]+(?:\W+\w+)?)\s*—[\s\S]+\.\s
は、私は、段落の開始点のみを抽出し、私はそれの残りの部分を抽出しません。
正規表現はあなたが望むよりも多かれ少なかれ抽出していますか? (私が疑うのは、あなたが怠け者[量詞](http://www.regular-expressions.info/repeat.html)を使わなかったためにあまりにも多くを抽出するということです)。 –
あなたはそうです。私は大文字の単語とサインの後に始まる最初の段落だけを余分にしようとしています。全体のデータセットに適用すると、あまりにも多くのデータが抽出されます –
これは混乱します。「最初のフルストップに」と指定します。それがあなたが得るものです。本当に欲しいものは何ですか? – ClasG