title: Output the first regex match against STDIN
body: <p>In bash, I have the following:</p>
  
  <pre><code>#!/bin/bash 
  curl $1 | tac | tac | perl -e '/(\d\d(?=:\d\d))/g; print $1' &gt; $2
  </code></pre>
  
  <p>All I want is to the first match from the output of <code>curl</code> and print it to the output file. I run the script with <code>./scriptname url outputfile.txt</code> but nothing is printed. My regex is valid on <a href="http://regexr.com" rel="nofollow noreferrer">http://regexr.com</a>, so I'm sure it's something I don't know about Perl. What am I doing wrong? Thanks.</p>