@Alan-Kilborn said in Ignoring empty lines counting:
@guy038 said in Ignoring empty lines counting:
The regex ^$, indeed, does not count true empty lines !
but :
The regex ^\R does count empty lines !!
If the regex is purely an assertion, e.g. ^$ or \b (to name but two), then its match won’t be counted by Count.
True (since a pure assertion is always an empty match), but empty matches aren’t counted regardless of how the regular expression is specified. In a file that has empty lines, but no lines containing only capital Ws, ^W*$ counts zero matches. ^\R counts all empty lines (except the last line, if it’s empty) because it isn’t an empty match: it matches line ending characters. ^.*$ and ^.+$ both count all lines that are not empty.