title: Matching token sequences
body: <p>I have a set of n tokens (e.g., a, b, c) distributed among a bunch of other tokens. I would like to know if all members of my set occur within a given number of positions (window size). It occurred to me that it may be possible to write a RegEx to capture this state, but the exact syntax eludes me.</p>
  
  <pre>
            11111
  012345678901234
  ab ab bc  a cba
  </pre>
  
  <p>In this example, given window size=5, I would like to match <code>cba</code> at positions 12-14, and <code>abc</code> in positions 3-7. </p>
  
  <p>Is there a way to do this with RegEx, or is there some other kind of grammar that I can use to capture this logic?</p>
  
  <p>I am hoping to implement this in Java. </p>