title: Windows Batch - check if string starts with ... in a loop
body: <p>this grabs the output from a remote branch list with git::</p>
  
  <pre><code>for /f "delims=\" %r in ('git branch -r') do (
  ::then in here I want to get rid of the origin/HEAD -&gt; line of the output
  ::and do a few git ops on the other lines, which are the names of branches
  )
  </code></pre>
  
  <p>anyhow, I'm finding this frustrating as apparently batch doesn't have regex</p>
  
  <p>here's the code I'm using to do this in bash</p>
  
  <pre><code>for remote in `git branch -r | grep -v '\-&gt;'`;
  do echo $remote; #...git stuff
  done;
  </code></pre>
  
  <p>the grep removes the "origin/HEAD -> origin/master" line of the output of git branch -r</p>
  
  <p>So I'm hoping to ask how to implement the 'contains' verb</p>
  
  <pre><code>for /f "delims=\" %r in ('git branch -r') do (
  if not %r contains HEAD (
  ::...git stuff
  )
  )
  </code></pre>
  
  <p>on a loop variable</p>
  
  <p><a href="https://stackoverflow.com/questions/7005951/batch-file-find-if-substring-is-in-string-not-in-a-file">this stackoverflow question</a> appears to answer a similar question, although in my attempts to implement as such, I became confused by % symbols and no permutation of them yielded function</p>
  
  <p>EDIT FOR FUTURE READERS: there is some regex with findstr /r piped onto git branch -r</p>