Get text occurrences between newlines
<p>I have this for an example</p>

<pre><code>test¶test1¶test2¶test3
</code></pre>

<p>This should return 4</p>

<p>However</p>

<pre><code>test¶test1¶test2¶
</code></pre>

<p>should return 3 because there is not text after the 3rd newline.</p>

<p>I can do something like </p>

<pre><code>str.split("\n").length
</code></pre>

<p>This will only give me the amount of newlines. I'm not sure what to try to just return text between the newlines. Would regex work?</p>

<p>Thanks for any help</p>
