title: Batch - Compare variable with regular expression
body: <p>I'm doing a batch script that has to check if there are some programs installed on the computer. For that, I execute <code>programName --version</code> and I store the output in a variable. The problem is when I try to compare with a regular expression (only to know if this program exists in the machine). I'm trying this code, but does't work</p>
  
  <pre><code>&gt;output.tmp node --version
  &lt;output.tmp (set /p hasNode= )
  if "%hasNode%" == "[vV][0-9.]*" (echo Has node) else (echo You have to install node)
  </code></pre>
  
  <p>If I change the regular expression for the output of this command works properly, so I suppose that I'm doing a bad use of the regular expression (I've checked it and it's fine for the command's output)</p>
  
  <p>Thanks four your help guys </p>