私は以下の文章を持っています。複数の行に一致する正規表現
^0001 HeadOne
@@
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
^0002 HeadTwo
@@
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
^004 HeadFour
@@
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
^0004 HeadFour
@@
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
以下は、私が検索に使用している正規表現です。
@@([\n\r\s]*)(.*)([\n\r\s]+)\^
が、これは、これらのようなだけ^0001
と^0003
をキャッチされては、唯一の段落を持っていますが、私のテキストにマルチパラコンテンツがあります。
私はVSコードを使用していますが、誰かに私がVSコードまたはNPPでREGEXを使用してそのような複数のパラ文字列をキャプチャする方法を教えてください。
おかげ
\ sは通常空白ですが、削除するか、0を示す*を付けてみてください –
予想される一致は何ですか?その理由は何ですか? @カルビン、VSCodeで、 '\ s'は改行にマッチしません。末尾の境界をどのように定義できますか? '@@'は常に行頭にありますか? –
@WiktorStribiżew '@@'を使用すると直接一致します – user3872094