Regex for first page?
Everything up to page break \f
This only finds the last line of first page
"end of page one"
I need all 4 lines
"first page"
"second line"
"search string"
"end of page one"
adding \s did not fix it for me
[\s|S] just blows through the \f and finds everything
string input = "first page" + Environment.NewLine +
"second line" + Environment.NewLine +
"search string" + Environment.NewLine +
"end of page one\f" +
"second page" + Environment.NewLine +
"second line" + Environment.NewLine +
"search string" + Environment.NewLine +
"end of page two\f";
public string Input { get { return input; }}
public string FirstPage
{
get
{
//@"((.*)\f)\1(<SEARCH STRING GOES HERE>)"); this is what in the end I need to do
string pattern = @"(.*)\f";
Match match = Regex.Match(input, pattern, RegexOptions.Multiline);
if (match != null)
{
return match.Value;
}
else
return "noot found";
}
}
(.*?)\f
instead to make it lazy..