title: How to filter sting with "[" and "]" inside using grep?
body: <p>How to filter anything inside <code>"&lt;torrent:magnetURI&gt;&lt;![CDATA["</code> and <code>"]]&gt;&lt;/torrent:magnetURI&gt;"</code> so it would output the string "EXAMPLE" using grep?</p>
  
  <pre><code>&lt;torrent:magnetURI&gt;&lt;![CDATA[EXAMPLE]]&gt;&lt;/torrent:magnetURI&gt;
  </code></pre>
  
  <p>I'm trying to get all the magnet url in the web and add them to transmission.</p>
  
  <pre><code>for url in $(wget -q -O- "http://sample.com/rss.xml" | grep -o '&lt;torrent:magnetURI&gt;&lt;![CDATA["[^"]*' | grep -o '[^&gt;]*$'); do 
  transmission-remote localhost:9091 -a "$url"; 
  done
  </code></pre>