简体   繁体   中英

Regex: Match everything after first blank line

I am trying to create a regex that matches everything after but not including the first blank line in c#.

Example:

having input of:

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

would result in:

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

even this stuff

You can use single line and multiline flag in a regex like this:

^$.*

Working demo

在此处输入图片说明

Btw, if you have multiple white spaces in the line, then you could use:

^\s*$(.*)

And then grab the content from the capturing group

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM