title: Batch findstr regular expression to grep an item from a single line
body: <p>How can I use Microsoft findstr to "grep" an item from a single line?</p>
  
  <p>I've got a line that goes something like this:</p>
  
  <pre><code>&lt;config&gt;test&lt;/config&gt;&lt;item&gt;some data&lt;/item&gt;&lt;date&gt;2007-11-02&lt;/date&gt;&lt;datestart&gt;2007-10-31&lt;/datestart&gt;&lt;path&gt;d:\test\test\test.txt&lt;/path&gt;
  </code></pre>
  
  <p>Now if I want to grep the content inside of <code>&lt;date&gt;</code> and <code>&lt;/date&gt;</code> how would I write that regular expression?</p>
  
  <p>One thing to note is that I will have to take the findstr command into a for-loop in order to grep the date and store it in a variable.</p>
  
  <p>example:</p>
  
  <pre><code>for /f "Tokens=* Delims=" %%i in ('findstr /r /c:"regex" file.txt') do (
      set date=%%i
      set date=!date:-=!
  )
  </code></pre>
  
  <p>Also, I don't want to rely on tokens as they may vary.</p>