title: How to subset vector based on string character?
body: <p>I have a vector composed of entries such as "ZZZ1Z01Z0ZZ0", "1001ZZ0Z00Z0", and so on, and I want to subset this vector based on conditions such as:</p>
  
  <ol>
  <li>The third character is a Z</li>
  <li>The third AND seventh characters are Z</li>
  <li>The third AND seventh characters are Z, AND none of the other characters are Z</li>
  </ol>
  
  <p>I tried playing around with strsplit and grep, but I couldn't figure out a way to restrict my conditions based on the position of the character on the string. Any suggestions?</p>
  
  <p>Many thanks!</p>