title: Overlapping matches in Regex
body: <p>I can't seem to find an answer to this problem, and I'm wondering if one exists. Simplified example:</p>
  
  <p>Consider a string "nnnn", where I want to find all matches of "nn" - but also those that overlap with each other. So the regex would provide the following 3 matches:</p>
  
  <ol>
  <li><b>nn</b>nn</li>
  <li>n<b>nn</b>n</li>
  <li>nn<b>nn</b></li>
  </ol>
  
  <p>I realize this is not exactly what regexes are meant for, but walking the string and parsing this manually seems like an awful lot of code, considering that in reality the matches would have to be done using a pattern, not a literal string.</p>