私は抽出する必要があるテキストブロックを持っています。私は現在、この正規表現を使用していますが、ファイルの最後まですべてのテキストを取得しています。どのように私はそれが最初の4行はRテキストブロックを取得する
正規表現あなただけ"\r\r\r\r"
でString.Split
を使用することができそうです
Regex(@"Education(\W+|\D+|\S+)*(^\r\r\r\r)*?",
RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Multiline);
EDUCATION
Some Text
01/07/1911- Some Text
01/23/1988 Some Text
Some Text Some Text
01/11/1999- Some Text
01/13/1911 Some Text
Some Text: Some Text
01/01/1966- Some Text
01/30/1911 Some Text
Some Text: Some Text/Some Text
01/01/1911- Some Text
01/30/1911 Some Text
01/01/1922- Some Text
01/30/1933 Some Text
Start of other text
「@」教育(?:(?!\ r {4})を試してください)。あなたは '' \ r \ r \ r \ r \ r "'で分割することもできます。 –
@WiktorStribiżewありがとうございました。あなたが答えとしてそれを置くなら、私は答えとしてマークします。 – Sorceri