title: How can I safely extract the URL in Emacs regex
body: <p>I'm having a hell of a problem reliably extracting the URL from an HTTP header using regex. It's not helped by the header alternately arriving with and without ^M characters which don't seem to match the white space class. Currently the best I've managed so far is:</p>
  
  <pre><code>(re-search-forward "^x-url: .*/\\{2,3\\}\\(.*\\)" nil t)
  </code></pre>
  
  <p>But of course that also picks up the ^M if it exists as well as the URL paramters which I don't really need. To give you an example from my debugging:</p>
  
  <pre><code>x-url: http://wiki/mediawiki/index.php?title=Vsmux&amp;action=edit&amp;redlink=1
  x-url: http://wiki/mediawiki/index.php?title=Vsmux&amp;action=edit&amp;redlink=1^M
  </code></pre>
  
  <p>What I really want in both cases is just the result:</p>
  
  <pre><code>wiki/mediawiki/index.php
  </code></pre>