title: Get substring from string with grep command
body: <p>I have the following pattern of a string:</p>
  
  <pre><code>"METHOD URL VERSION"
  </code></pre>
  
  <p>example <code>"GET /someurl/resource.html HTTP/1.1"</code></p>
  
  <p>How can I get the url from this string with grep.</p>
  
  <p>I did the following(assuming that string contains in f.txt)</p>
  
  <pre><code>cat f.txt | grep -P '[^(( )|(\")|(HTTP\/\d\.\d)|(GET)|(POST))]+' -o
  </code></pre>
  
  <p>but it gives me such an output</p>
  
  <pre><code>someurl
  resource
  html
  </code></pre>
  
  <p>How can I retrieve /someurl/resource.html ?</p>