hello, I want to select (to match) the first 5 lines from a text, that are not empty.
How can I do this?
hello, I want to select (to match) the first 5 lines from a text, that are not empty.
How can I do this?
\`(\s*^(\h*\S.*)){5}
http://www.boost.org/doc/libs/1_44_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
Edit: If you then want to select the lines individually (i.e. one selection for each line), do this:
^\h*\S.*
and can you tell me how can I select the last 5 lines?
I try something like this \S.*\z but will match only the last line
((^\h*\S.*)\s*){5}\Z
I don’t know why, but neither \'
nor \z
seem to work. However, \Z
does and is probably even better than the others.