Regex in perl, match newline AND first word of next line
<p>I have a file that looks like</p>

<pre><code>title="title1"  
artist="artist1"  
title="title2"  
artist="artis2"  
title="title3"  
artist="artist3"
</code></pre>

<p>And so on</p>

<p>this command<br>
<code>perl -pe 's/title="(.*?)"\n//ig' list.txt</code></p>

<p>Is not working as I'd hope.  If I do that alone, I get just the artist lines, BUT if I do this  </p>

<p><code>perl -pe 's/title="(.*?)"\nartist//ig' list.txt</code></p>

<p>It doesn't match at all.<br>
I've tried with and without the /g and tried with the addition of a /m
I've look at the file in nano, and I don't see any additional characters between the final " in each line and the "artist" in the next.</p>

<p>Anyone know what I'm doing wrong?  (I'm using perl rather than sed, because the regex that generates this list uses a negative lookahead).</p>

<p>My goal is to be able to use a line like below<br>
<code>perl -pe 's/title="(.*?)"\nartist="(.*?)"(?:\n|$)/\2 - \1/ig' list.txt</code>  </p>

<p>That would output something like  </p>

<pre><code>artist1 - title1  
artist2 - title2  
artist3 - title3
</code></pre>