title: Find the indexes of all regex matches?
body: <p>I'm parsing strings that could have any number of quoted strings inside them (I'm parsing code, and trying to avoid PLY).  I want to find out if a substring is quoted, and I have the substrings index.  My initial thought was to use re to find all the matches and then figure out the range of indexes they represent.</p>
  
  <p>It seems like I should use re with a regex like <code>\"[^\"]+\"|'[^']+'</code> (I'm avoiding dealing with triple quoted and such strings at the moment).  When I use findall() I get a list of the matching strings, which is somewhat nice, but I need indexes.</p>
  
  <p>My substring might be as simple as <code>c</code>, and I need to figure out if this particular <code>c</code> is actually quoted or not.</p>