title: Simple regular expression parsing in bash
body: <p>I want to parse a log file (log.txt) which contains rows similar to these:</p>
  
  <pre><code>2010-10-19 07:56:14 URL:http://www.website.com/page.php?ID=26 [13676] -&gt; "www.website.com/page.php?ID=26" [1]
  2010-10-19 07:56:14 URL:http://www.website.com/page.php?ID=44 [14152] -&gt; "www.website.com/page.php?ID=44" [1]
  2010-10-19 07:56:14 URL:http://www.website.com/page.php?ID=13 [13681] -&gt; "www.website.com/page.php?ID=13" [1]
  2010-10-19 07:56:14 ERROR:Something bad happened
  2010-10-19 07:56:14 ERROR:Something really bad happened
  2010-10-19 07:56:15 URL:http://www.website.com/page.php?ID=14 [12627] -&gt; "www.website.com/page.php?ID=14" [1]
  2010-10-19 07:56:14 ERROR:Page not found
  2010-10-19 07:56:15 URL:http://www.website.com/page.php?ID=29 [13694] -&gt; "www.website.com/page.php?ID=29" [1]
  </code></pre>
  
  <p>As you might have guessed:</p>
  
  <p>1) I need to extract this portion from each row:</p>
  
  <pre><code>2010-10-19 07:56:15 URL:http://www.website.com/page.php?ID=29 [13694] -&gt; "www.website.com/page.php?ID=29" [1]
  ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  </code></pre>
  
  <p>2) This portion goes to another file (log.html) like this:</p>
  
  <pre><code>&lt;a href="http://www.website.com/page.php?ID=29"&gt;http://www.website.com/page.php?ID=29&lt;/a&gt;
  </code></pre>
  
  <p>I need to do this via bash script, which will run on a *nix platform. I have no idea about shell programming so detailed script will be much appreciated, pointers to bash programming reference will do.</p>