簡體   English   中英

正則表達式:匹配第一個空白行之后的所有內容

[英]Regex: Match everything after first blank line

我正在嘗試創建一個匹配所有但不包括c#中的第一個空白行的正則表達式。

例:

輸入以下內容:

This is header info
that I dont'  : really want
in my file

I want everything below this line
until the end of the file

even this stuff

會導致:

I want everything below this line
until the end of the file

even this stuff

您可以在正則表達式中使用單行和多行標志,如下所示:

^$.*

工作演示

在此處輸入圖片說明

順便說一句,如果行中有多個空格,則可以使用:

^\s*$(.*)

然后從捕獲組中獲取內容

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM