title: Regex in Batch Windows
body: <p>I am currently working on a batch job(and I am new to this as well) to get a list of maven dependencies .
  Been working to fetch those dependencies using regex but to no avail. I have tested my regex on this <a href="https://regex101.com/" rel="nofollow noreferrer">site</a> and it seems it's working.</p>
  
  <p>Checked the needed escape characters inside a FOR loop from this <a href="https://stackoverflow.com/questions/6828751/batch-character-escaping">stackoverflow question</a> but again, to not avail thus I have resorted to ask help in here.</p>
  
  <p>See below for my code snippet esp. the regex part, the outer loop is fine.</p>
  
  <pre><code>for /f "tokens=*" %%i in ('findstr "+- \\-"  dependency-list.txt') do (
      for /f "tokens=*" %%j in ('findstr /i /r "^^(.+^)\[:\]^(.+^)^(:jar:^)^(.+^)^(:compile^)" %%i') do (
          echo %%j
      )
  )
  </code></pre>
  
  <p>And this is the sample data fetched from my outer loop:</p>
  
  <pre><code>[INFO] +- org.owasp.esapi:esapi:jar:2.0.1:compile
  [INFO] |  +- commons-configuration:commons-configuration:jar:1.5:compile
  [INFO] |  |  +- commons-lang:commons-lang:jar:2.3:compile
  </code></pre>
  
  <p>I wanted to get these part only using regex:</p>
  
  <pre><code>commons-configuration:commons-configuration:jar:1.5:compile
  org.owasp.esapi:esapi:jar:2.0.1:compile
  commons-lang:commons-lang:jar:2.3:compile
  </code></pre>
  
  <p>These are the errors I'm getting when trying to execute my batch script.</p>
  
  <pre><code>FINDSTR: Cannot open org.owasp.esapi:esapi:jar:2.0.1:compile
  '+-' is not recognized as an internal or external command,
  operable program or batch file.
  | was unexpected at this time.
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>NOTE:
  Once I am able to execute my regex successfully, the outer loop can be removed.</p>